Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVA

android studio json parser

/*
if respond is array
respond = [ {"a": "a", "b" : [1,2] } ]
*/
JSONArray ja1 = new JSONArray(respond);
JSONObject jo= ja1.getJSONObject(0); // {"a": "a", "b" : [1,2] }

String a = jo.getString("a"); // a
JSONArray ja2 = jo.getJSONArray("b"); // [1,2]
 
PREVIOUS NEXT
Tagged: #android #studio #json #parser
ADD COMMENT
Topic
Name
3+5 =