How to parse this type of json array in android?

Suppose “response” is your JSONResponse

JSONObject jsonObject = new JSONObject(response);// This is used to get jsonObject from response

String sCode=jsonObject.optString("scode"); // This is how you can parse string from jsonObject
JSONArray allmenuArray=jsonObject.optJSONArray("all_menu"); //This is how you can parse JsonArray from jsonObject
for(int i=0;i<allmenuArray.length();i++){
JSONObject objectJson=allmenuArray.optJSONObject(i);//This is how you can parse jsonObject from jsonArray
}

Like This you can parse all your jsonObject and jsonarray. Just follow these steps you can easily parse your full JSONResponse

Leave a Comment