Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Problem with code for implementing REST web service in android

I have created two input fields using EditText, a TimePicker , a Spinner along with a submit button using basic tutorials in Android. The code for which I have mentioned in this link : (http://ideone.com/42aYs)

I have also created a webservice using REST in netbeans which exposes a database I created in the MySQL that comes within Netbeans as per this tutorial [link] (http://netbeans.org/kb/69/websvc/rest-mysql.html) .. So now i have obtained the WSDL URL and the XML..I just need to call that values of database i created when i click submit button on phone..

How to do that? How do I show the values of the database on my phone ? What changes should I need to do for my code

like image 741
Parth Doshi Avatar asked Dec 12 '25 11:12

Parth Doshi


1 Answers

I have had good experience using Android's HttpClient to call a RESTful web service from within my app. I referenced this tutorial which is extremely reusable for calling web services. You will need to provide the REST client with the URL you are trying to access, and the resultant data will be read into the container of your choice. It is common practice for a RESTful web service to return JSON data, so you may also be looking for a JSON->Java object parser (may I recommend google-gson?)

like image 99
Ben Siver Avatar answered Dec 14 '25 07:12

Ben Siver



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!