Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to make a web service (preferably using PHP) that can be requested to get JSON objects by the android app

I am making an Android App which interacts with remote server's database and communicate with each other by passing JSON object to and from.

I need to know how to write such a service on my server (preferably in PHP) to which the android app can make request and on receiving the request, the server processes and makes a JSON object and passes that to the android app.

Also, i need to know, when this service is running on the server, on WHICH URL will the android app make request?

For example, if android app have to request to sever to fetch data for parameters: name: Apple location: US then, i guess the android app will have to request the server in form of: www.example.com?name='Apple"&location='US'

So how to make such a service running on the remote server?

Thanks in advance !

like image 245
user1599964 Avatar asked Jan 15 '23 12:01

user1599964


1 Answers

The best example you can refer for this is http://www.androidhive.info/2012/01/android-login-and-registration-with-php-mysql-and-sqlite/. It has complete code[php+ android] with simple explanation.

like image 153
Kartik Domadiya Avatar answered Jan 30 '23 22:01

Kartik Domadiya