[
{
"0": "1",
"1": "ANIMALS",
"2": "7a415-lion.png",
"id": "1",
"category_name": "ANIMALS",
"category_image": "http://dev1.sbsgroupsolutions.co.in/emoticonapp/admin/assets/uploads/7a415-lion.png"
}
]
Asked
Active
Viewed 86 times
1

Linda Lawton - DaImTo
- 106,405
- 32
- 180
- 449

Abhilasha Satle
- 53
- 4
-
What did you tried ? There is tons of examples show us some code... – Damien R. May 22 '14 at 07:25
-
@Abhi Satle It's simple, with gson you can convert a JSON object to java object. – Mari_Yaguchi May 22 '14 at 07:30
3 Answers
0
if something is returning you this json array then store it in a jsonarray object :-
JSONArray array;
Then instantiate a JSONObject :-
JSONObject object = array.getJSONObject();
give the necessary index.
and then use getString to get the values . Eg.
String s1 = object.getString("id");

Soumil Deshpande
- 1,622
- 12
- 14
0
try this
JSONArray jsonArray = new JSONArray(jsonresponse);
JSONObject jsonObj = jsonArray.getJSONObject(0);
String categoryname=jsonObj.getString(category_name);

skyshine
- 2,767
- 7
- 44
- 84
-
It's better if you explain *why* your code solves the problem. See [answer]. – brasofilo May 22 '14 at 08:07