My json output is as follows:
How to parse it in Android?
I have been using iteration to loop over object collection1 without success. I want to access my array collection1 under object result:
if (jsonStr != null) {
try {
JSONObject jsonObj = new JSONObject(jsonStr);
// Getting JSON Array node
contacts = jsonObj.getJSONArray(TAG_CONTACTS);
// looping through All Contacts
for (int i = 0; i < contacts.length(); i++) {
JSONObject c = contacts.getJSONObject(i);
String id = c.getString(string1);
String name = c.getString(string2);
String email = c.getString(string3);
String address = c.getString(string4);
String gender = c.getString(string5);
...
jsonStrand at least complete the code snippet you included.