title: Parsing JSON array and object in Android
body: <p>This is what the JSON looks like:</p>
  
  <pre><code>[{
      "pmid": "2",
      "name": " MANAGEMENT",
      "result": "1",
      "properties": [
          {
              "prop_id": "32",
              "prop_name": "Bonneville",
              "address": "122 Lakeshore",
              "city": "Ripley",
              "state": "OH",
              "zip": "11454",
              "lat": "41.123",
              "long": "-85.5034"
          }
      ]
  }]
  </code></pre>
  
  <p>I am trying to parse it with the following Java code in Android:</p>
  
  <p>JSONObject jObj = null;
      try {
          jObj = new JSONObject(jsonStr);</p>
  
  <pre><code>    // We get weather info (This is an array)
      JSONArray jArr = jObj.getJSONArray("properties");
  
      // We use only the first value
      //JSONObject JSONWeather = jArr.getJSONObject(0);
      JSONObject c = jArr.getJSONObject(0);
      String name = c.getString(TAG_NAME);
      String email = c.getString(TAG_EMAIL);
      String phone = c.getString(TAG_PHONE);
  } catch (JSONException e) {
      e.printStackTrace();
  }
  
  return null;
  </code></pre>
  
  <p>I am not getting any results though. How can I successfully parse this JSON? I'm using Android Studio.</p>
  
  <p>Also, if there were multiple pieces to the array, how could we make sure each one of them is printed out? </p>