Thursday, October 1, 2015

Android accessing RESTFull Web Services using JSON

I just finished a huge project for school using the Google Android OS. The biggest hurdle I had to jump through we getting android to successfully talk to web services. I have put together a set of classes and procedures to do so that make it easy and reliable. I have taken some code from here and there and adapted my own. It was a while ago so I don’t recall where I found it all. For this example I am going to be using the web service  http://www.sumasoftware.com/alerts/GetAlerts.php to read the alerts.
The first thing you’ll need to download and add to your project is the google GSON libraryhttp://code.google.com/p/google-gson/downloads/list
Add the jar file to your android project as an external jar
Download the following WebService.java class in order to interact with the web service and add it to your project
?

http://www.josecgomez.com/2010/04/30/android-accessing-restfull-web-services-using-json/