I want to ask you a question about REST web service and Android.
I want to make an application which communicates with a remote database and display the values in a listview. Now, the problem at the moment is how to communicate with a remote database: I’ve read about REST services and I’ve understand they are necessary if you want to communicate with a db in a safe way, but I don’t know how to make it really.
My idea of this application is: I connect to a .php page placed in a remote server (using a free domain) and there i create the query to the database, so:
ANDROID APPLICATION —–> PHP FILE —-> REMOTE DATABASE
The question are:
- Where do I implement REST services?
- Is my idea right? Or should I change something?
- Does someone have a snippet or tutorial about this problem or generally about REST services? I’ve searched on the net but I haven’t found anything.
Thank you.
First result in Google:
http://www.techrepublic.com/blog/app-builder/calling-restful-services-from-your-android-app/1076
It has a code example of fetching data from Android via an exposed web resource.
Also other SO Qs about this, for example: How to call a RESTful web service from Android?
Did you really search that hard?;)
Since you wrote an Android question I assume you know the PHP part so, otherwise it shouldn’t be more than a google search away!