In Android I want to call webservice which is made into php with Json response.
How to call that webservice and how to store the response into array?
In Android I want to call webservice which is made into php with Json
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
I would recommend looking into REST services. The basic structure is to have your android app preform HTTP requests(preferably in a separate thread) to the server and have the server respond with xml or json.
Heres a threaded http post class i use often.
Whenever you need to communicate with the server you do something like this.
To answer you question below, the service can be implemented with any number of technologies. Below is a simple example of a php service that gets the key/value pair from the example above.
Example of a simple PHP service
When the server responds handleMessage will be called and the value inside of answer be whatever your php service echos.