Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVA

How to parse json array in java

//[{"name":"name1","url":"url1"},{"name":"name2","url":"url2"}]
JSONArray jsonarray = new JSONArray(jsonStr);
for (int i = 0; i < jsonarray.length(); i++) {
    JSONObject jsonobject = jsonarray.getJSONObject(i);
    String name = jsonobject.getString("name");
    String url = jsonobject.getString("url");
}
for more info  https://stackoverflow.com/questions/18977144/how-to-parse-json-array-not-json-object-in-android
 
PREVIOUS NEXT
Tagged: #How #parse #json #array #java
ADD COMMENT
Topic
Name
9+4 =