here is code for getting lat lng from json
List<Double> lat = new ArrayList<>();
List<Double> lng = new ArrayList<>();
try {
JSONObject jsonObject= new JSONObject(response);
JSONArray jsonArray= jsonObject.getJSONArray("results");
for(int i=0;i< jsonArray.length();i++)
{
lat.add(jsonArray.getJSONObject(i).getJSONObject("geometry").getJSONObject("location").getDouble("lat"));
lng.add(jsonArray.getJSONObject(i).getJSONObject("geometry").getJSONObject("location").getDouble("lng"));
}
} catch (JSONException e) {
e.printStackTrace();
}
1
solved How to get Object from json /