http://docs.blackberry.com/sampledata.json
This is my web service and I want to parse and retrieve vehicleType, vehicleColor, fuel, name, experiencePoints, treadType
try{
HttpGet request = new HttpGet(loginUrl);
HttpResponse response = httpClient.execute(request);
entityResponse = response.getEntity();
result = EntityUtils.toString(entityResponse);
JSONArray array = object.getJSONArray("routes");
---Parsing first jsonArray
JSONObject routes = array.getJSONObject(0);
---(parsing first jsonarray object)
String bounds= routes.getString("bounds");
-- parsing second josn Array
JSONArray legs = routes.getJSONArray("legs");
--- (parsing second jsonarray object)
JSONObject steps = legs.getJSONObject(0);
String distance= routes.getString("distance");
--- parsing third json Array
JSONArray legs1 = steps.getJSONArray("steps");
for(int i = 0; i < legs1.length(); i++){
JSONObject steps1 = legs1.getJSONObject(i);
--parsing third jsonarray objecct
String htMlVale = steps1.getString("html_instructions").toString();
-- parsing inside third jsonarray of jsonarray
JSONObject distance = steps1.getJSONObject("distance");
String sDistance = distance.getString("text");()
}
}