How do i parse json object and json array in android? [duplicate]

You can use JSONObject its default supplied with android SDK:

String json = "some JSON";
JSONObject jsonObject = new JSONObject(json);

Than you can use methods like

getBoolean(String key)
getDouble(String key)

etc

Or you can use google gson library which is in my opinion better, but you will need to include it as dependency in gradle.

There is github for the Gson.

There is Gson API

Leave a Comment