model:
public class Geometry { public String type; public List<Position> coordinatesRoute; public double[] coordinatesPoint; method for recover jsonObjet JSONObject objectResponse = new JSONObject(res); JSONArray JarrayFeatures = objectResponse.getJSONArray("features"); for (int i = 0; i < JarrayFeatures.length(); i++) { JSONObject jsonObjFeatures = JarrayFeatures.getJSONObject(i); Log.e("jsonObjFeatures:", " " + jsonObjFeatures); //geoFeatures.setType((String) jsonObjFeatures.get("type")); features.setType((String) jsonObjFeatures.get("type")); JSONObject objectGeometry = jsonObjFeatures.getJSONObject("geometry"); geometry.setType((String) objectGeometry.get("type")); Log.e("objectGeometry:", "" + objectGeometry); //problems geometry.setCoordinatesPoint((double[]) objectGeometry.get("coordinates")); JSON:
"features": [ { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ 2.1163, 48.8288 ] }, I am trying to recover the value coordinates of my json which is a double array. Thank you for your help.