1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;

JSONObject jsonObject = new JSONObject();
JSONArray the_json_array = new JSONArray();
ArrayList<JSONObject> jsonArray = new ArrayList<JSONObject>();

try 
{
        // I'm creating my expected json reponse manually here for demo purposes...
        jsonObject = new JSONObject("{\"STATUS\": \"SUCCESS\", \"place\": [{\"cafe_id\": \"28\", \"cafe_title\": \"Kiriya Café\"} ]}");
	the_json_array = jsonObject.getJSONArray("place");
			        
	int size = the_json_array.length();
	String cafe_id = null;
	String cafe_title = null;
			         
	for (int i = 0; i < size; i++) 
	{
		JSONObject local_json_object = the_json_array.getJSONObject(i);
		jsonArray.add(local_json_object);
			             
		// Now jsonArray contains everything from "place"...
		cafe_id = jsonArray.get(i).getString("cafe_id");
		cafe_title = jsonArray.get(i).getString("cafe_title");
	}
			         
					
} 
catch (JSONException e) 
{
	// TODO Auto-generated catch block
	e.printStackTrace();
}