I have some JSON with the following structure:
{\"source\":[ {\"name\":\"john\",\"age\":20}, {\"name\":\"michael\",\"age\":25},
This could be an answer to your question:
JSONArray msg1 = (JSONArray) json.get("source"); for(int i = 0; i < msg1.length(); i++){ String name = msg1.getString("name"); int age = msg1.getInt("age"); }