Basic web service calling in android - android

I need a tutorial on how to do a basic web service call in android. I currently use ksoap but I and getting an error when I make the call and I need to know what the response from the server was. ksoap wont give me that information because it parses the response in the api where I am getting the error.
I am new to all this web service stuff so please help me out

Well it depends what you want to develop it using
A good tutorial using PHP, MySQL is here
I know you are using KSOAP at the moment but here is a nice tutorial that uses KSOAP and in explained in nice detail.

Related

Socket.io and node.js example in android

I am new to socket programming i have to use socket.io and node.js to connect with my server host in android so can anyone please just describe me the programming example of how to connect to server in android. And if possible please give some help regarding node.js and socket.io. As i have searched everywhere on google but not able to find out the proper example.
Thanks
You can just have your web service be REST base.
Your Android application can just talk to your web server via REST and receive data json or xml whatever you fancy.
So with node.js you should set up routes.
An example would of a route would be
www.example.com/users via GET post would return a list of users either in JSON/XML
For your android application you need a library, I believe there's a built in one already, to make request for certain routes such as www.example.com/users via GET method and write the logic to expect JSON or XML and parse that.
I just googled this:
Android: https://github.com/koush/ion
As for node.js you just have to build route...
I think is would be better:
websocket api to replace rest api?
It actually invalidate my answers sorry, REST and websocket api are different.
I have no clue what problem exactly you have. But you should break your problems down to small part. And google and search for answer for each smaller part which would make your life easier to google.
Get your webservice up first so that your android software can consume stuff, build a prototype and then build a prototype of android app that consume data from that webservice.

App Reading From SQL Server Web Service

I am in the process of creating an Android application which I want to use to execute a web service on my SQL server which in turn runs a stored procedure.
Having never completed a project like this before, I would like to know what the best way to go about this is?
I.e.
Displaying the SQL results
Reading from the web service
Adding password protection
I've developed apps before, but never SQL - related.
From doing some research I noted the need for a web service and created one, it's the process of running my app to read from it which I would like guidance with. Even a link to a helpful tutorial would be great. Thanks.
EDIT
To be more specific on the display.
Currently the stored procedure is displayed through crystal reports, however I have no need for 'drill - downs' or any functionality other than to actually view.
Something similar without the functionality would be fine.
I would recommend KSOAP with a SOAP webservice for proof of concept/tech demo http://seesharpgears.blogspot.com/2010/11/basic-ksoap-android-tutorial.html
or use the built-in JSON parser with a restful/json webservice
How to call a json webservice through android
Perhaps this link can help you, it has a useful video on the subject and detailed information.
Another link Comsuming WCF Services With Android
And also maybe this could help: Android Web Service MyWeather

Consuming a .net web service returning a dataset in an ANDROID application

We have an EPOD application running on the windows mobile platform. We are now trying to port the same application to the ANDROID platform. The application uses a web service written in .net to communicate with the server and perform various functions. The web service returns a dataset, which we are unable to parse directly in the ANDROID application and view the details. We are trying KSOAP and the JSON ways. If anyone out there has done this before, please help us out. We have be trying to find a solution for a week without any success. If required, we can even modify the web service so that it returns an XML or a JSON object which we can then parse in the ANDORID application.
Any help / sample code will be much appreciated.
Thanks and Regards
Rajendran Menon
.Net services used in interoperable environments (= non .Net clients) should not use datasets. You have already find why. The best you can do is modifying the service to expose simple soap or json = use custom data objets as return values from you service operations.
.net service returning a dataset will be received as an xml document at client end, so without thinking too much about the integration, just grab some code which can call xml webservice and get data from it.
Since there are many ways to solve this, here are additional links that can help:
How to call a .NET web service from android?
http://lukencode.com/2010/04/27/calling-web-services-in-android-using-httpclient/
http://www.slideshare.net/sullis/connecting-to-web-services-on-android
Let me know if I can help you. I have prior experience with calling .net web services from java.

Calling webservice from android application without Ksoap

What would be best and simplest way to call Yahoo weather webservice/any json webservice in android?
Some people suggest not to use Ksoap for mobile application instead use Restful or Json webservice.
TIA
Bhaskar
In short, use HttpClient, HttpGet, and JSONObject
Without any more details, this is probably similar to what you are attempting: http://www.josecgomez.com/2010/04/30/android-accessing-restfull-web-services-using-json/
Here's another post where this is discussed:
How to call a SOAP web service on Android
If you really want to be simple, just embed the content of the message in a HttpClient (included with Android by default) and manually parse the result.
Here (http://breaking-catch22.com/?p=127) is a link to an example of calling a REST web service.
Have a look at how Google APIs Client Library for Java does it, for example in this YouTube sample using HttpTransport and JSON:
http://code.google.com/p/google-api-java-client/source/browse?repo=samples#hg%2Fyoutube-jsonc-sample%2Fsrc%2Fcom%2Fgoogle%2Fapi%2Fclient%2Fsample%2Fyoutube

Android using kSoap with webservices other than .NET

I'm trying to make an application that's making a connection to an XML-page that I've built with Progress database. I've tried accessing it with kSoap2, following this tutorial (http://seesharpgears.blogspot.com/2010/10/web-service-that-returns-array-of.html).
It doesn't really go into my Progress Procedure, so I don't get any response, so I'm wondering if this kSoap actually works with other webservices than .NET webservices?
You can find my webservice class over here http://pastebin.com/50rhLCFr.
My domain class is built exactly like the tutorial and the Progresscode works if I save the file to XML.
Thank you very much!
I have worked with a number of web services alongside android and this is my usual debugging process:
Build up a request manually and POST it using some software such as SoapUI to verify it works
once you have successfully constructed a working request you can then simply HTTP POST it from within android
store your own request templates and fill them out using string replace
this technique avoids using Ksoap, which I have found to be quite annoying!

Categories

Resources