I'm trying to get the value of elevations from JSON in android but in the log nothing is shown. This JSON is a nested array, I'm still new toth parsing JSON in android.
This is what the JSON looks like :
This is my code :
try {
JSONObject responseObject = new JSONObject(result);
JSONArray elev = responseObject.getJSONArray("resourceSets");
JSONArray el = elev.getJSONObject(1).getJSONArray("elevations");
for(int i=0; i<=el.length();i++){
Log.d("EL",el.toString());
}
}
catch (Exception e){
e.printStackTrace();
}
