I am writing a simple Android app and have a database that will send back information into the app. I am new to Android and am looking for a simple example that demonstrates
I once wrote a tutorial for the exact opposite case (to send a JSON request). However from that you will be able to derive for what you need.
Take a look to: JSON Parsing in android or Android as a RESTful Client.
Also read Handling Expensive Operations in the UI Thread to be sure that your application is not "hanging" if content retrieval takes time.
I wrote a small library project (stepsdk) and demo here, on making a GET request and process the json here.
It is as simple as follows:
new APIRequest(new APIManager(this), SERVER_URL+"/method", APIRequest.GET)
.addParam('param', 'value')
.start(new JSONRequestHandler(){
@Override
public void after() {
JSONObject json = getResponse();
// use json
}
});
hope it helps.