title: How to access JSON data with multiple array objects : android
body: <p>I am stuck in getting the data from the JSON file with multiple data sets.</p>
  
  <pre><code>{
    "status": "ok",
    "count": 3,
    "count_total": 661,
    "pages": 133,
    "posts": [
      {
        "id": 20038,
        "type": "post",
        "slug": "xperia-launcher-download",
        "url": "http:\/\/missingtricks.net\/xperia-launcher-download\/",
        "status": "publish",
        "title": "Download Xperia Launcher app for Android (Latest Version)"
      },
      {
        "id": 94,
        "type": "post",
        "slug": "top-free-calling-apps-of-2014-year",
        "url": "http:\/\/missingtricks.net\/top-free-calling-apps-of-2014-year\/",
        "status": "publish",
        "title": "Best Free Calling Apps for Android November 2014"
      },
      {
        "id": 98,
        "type": "post",
        "slug": "top-free-calling-apps-of-2016-year",
        "url": "http:\/\/missingtricks.net\/top-free-calling-apps-of-2016-year\/",
        "status": "publish",
        "title": "Best Free Calling Apps for Android December 2016"
      }
    ]
  }
  </code></pre>
  
  <p>I need to access the title, url and status from the above JSON file.</p>
  
  <pre><code>@Override
      protected void onPostExecute(String result) {
          //this method will be running on UI thread
  
          pdLoading.dismiss();
          List&lt;DataFish&gt; data = new ArrayList&lt;&gt;();
          pdLoading.dismiss();
          try {
              JSONArray jArray = new JSONArray(result);
              // Extract data from json and store into ArrayList as class objects
              for (int i = 0; i &lt; jArray.length(); i++) {
                  JSONObject json_data = jArray.getJSONObject(i);
                  DataFish fishData = new DataFish();
                  fishData.status = json_data.getString("status");                 
                  fishData.title = json_data.getString("url");                  
                  fishData.sizeName = json_data.getString("title");
                  data.add(fishData);
              }
          } catch (JSONException e) {
              Toast.makeText(JSonActivity.this, e.toString(), Toast.LENGTH_LONG).show();
              Log.d("Json","Exception = "+e.toString());
          }
      }
  </code></pre>
  
  <p>I am getting a JSONException with the above code.</p>
  
  <p>What should I do to access the title,status and url from the JSON File?</p>