title: Get Elements of JSON Array Android
body: <p>I have a JSON file which looks like the following:</p>
  <pre><code>{&quot;posts&quot;:[{&quot;Latitude&quot;:&quot;53.38246685&quot;,&quot;lontitude&quot;:&quot;-6.41501535&quot;},
  {&quot;Latitude&quot;:&quot;53.4062787&quot;,&quot;lontitude&quot;:&quot;-6.3767205&quot;}]}
  </code></pre>
  <p>and I can get the first set of latitude and lontitude co-ordinates by doing the following:</p>
  <pre><code>JSONObject o = new JSONObject(s);
  JSONArray a = o.getJSONArray(&quot;posts&quot;);
  o = a.getJSONObject(0);
  lat = (int) (o.getDouble(&quot;Latitude&quot;)* 1E6);
  lng = (int) (o.getDouble(&quot;lontitude&quot;)* 1E6); 
  </code></pre>
  <p>Does anyone have an idea of how to get all the latitude and lontitude values ?</p>
  <p>Any help would be much appreciated.</p>