Search
 
SCRIPT & CODE EXAMPLE
 

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
Comment

PREVIOUS NEXT
Code Example
Java :: make recycler view non scrollable 
Java :: similarity between abstract class and interface java 
Java :: java replace all space with underscore 
Java :: text before dot java 
Java :: inject in jsp 
Java :: get sha key android 
Java :: java get domain from url 
Java :: java console write 
Java :: how to decompose a string into words in Java 
Java :: context path spring boot 
Java :: processing load font from file 
Java :: cannot set char field to null value java 
Java :: character classes in regex 
Java :: jersey test dependency 
Java :: java repeat loop cycle for 
Java :: character to lower java 
Java :: how to collect objective in java 
Java :: android java optional arguments 
Java :: lombok maven 
Java :: how does devision works in Java 
Java :: how to convert an object into string with different fields in java 
Java :: circle line intersection java 
Java :: list extension quarkus 
Java :: String array into LinkedList java 
Java :: sreekanth kasani 
Java :: fibunacci java 
Java :: java convert list to page 
Java :: array to array list 
Java :: sprint jpa properties for application.yml 
Java :: float random class java 
ADD CONTENT
Topic
Content
Source link
Name
7+2 =