Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Parse Current Json as:</p> <pre><code>JSONObject jsonObj = new JSONObject(jsonStr); // these 2 are strings JSONObject c = jsonObj.getJSONObject("meta"); String success = c.getString("success"); JSONArray jsonarr = jsonObj.getJSONArray("Countries"); // lets loop through the JSONArray and get all the items for (int i = 0; i &lt; jsonarr.length(); i++) { JSONArray jsonarra = jsonarr.getJSONArray(i); // lets loop through the JSONArray and get all the items for (int j = 0; j &lt; jsonarra.length(); j++) { JSONObject jsonarrtwo = jsonarra.getJSONObject(j); // these 2 are strings String str_id = jsonarrtwo.getString("id"); String str_Name = jsonarrtwo.getString("Name"); JSONArray jsonarr_cities = jsonarrtwo.getJSONArray("Cities"); // lets loop through the JSONArray and get all the items for (int t = 0; t &lt; jsonarr_cities.length(); t++) { // printing the values to the logcat JSONArray jsonarr_cities_one = jsonarrtwo.getJSONArray(t); for (int tt = 0; tt &lt; jsonarr_cities_one.length(); tt++) { // printing the values to the logcat JSONObject jsonarr_cities_two = jsonarr_cities_one.getJSONObject(tt); // these 2 are strings String str_idone = jsonarr_cities_two.getString("id"); String str_Nameone = jsonarr_cities_two.getString("Name"); } } } } </code></pre> <p>for parsing json try this tuts:</p> <p><a href="http://www.androidcompetencycenter.com/2009/10/json-parsing-in-android/" rel="nofollow">http://www.androidcompetencycenter.com/2009/10/json-parsing-in-android/</a></p> <p>for formatting json :</p> <p><a href="http://jsonviewer.stack.hu/" rel="nofollow">http://jsonviewer.stack.hu/</a> </p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload