I have this Json from URL:
{
"type":"FeatureCollection",
"features":
[
{
"type":"Feature",
"properties":
[
{
"type":"colliers",
"thumb":"upload\/estate\/135\/thumb_1. Prologis Park Wroclaw I.jpg",
"name_pl":"Prologis Park Wroc\u0142aw I",
"name_en":"Prologis Park Wroc\u0142aw I",
"completearea":"167 000",
"completeareaunit":"m2",
"workingarea":"",
"workingareaunit":"m2",
"id_type":"3",
"id":"135",
"lon":16.939201369628,
"lat":51.037378299619,
"images":["public\/upload\/estate\/135\/1. Prologis Park Wroclaw I.jpg"]
}
],
"geometry":
{
"type":"Point",
"coordinates":[16.939201369628,51.037378299619]
},
"crs":
{
"type":"name",
"properties":{"name":"urn:ogc:def:crs:OGC:1.3:CRS84"}
}
},
{
"type":"Feature",
"properties":
[
{
"type":"colliers",
"thumb":"upload\/estate\/136\/thumb_2. Prologis Park Wroclaw III.jpg",
"name_pl":"Prologis Park Wroc\u0142aw III",
"name_en":"Prologis Park Wroclaw III",
"completearea":"129 500",
"completeareaunit":"m2",
"workingarea":"",
"workingareaunit":"m2",
"id_type":"3",
"id":"136",
"lon":16.928386702881,
"lat":51.105440250407,
"images":
[
"public\/upload\/estate\/136\/2. Prologis Park Wroclaw III.jpg"
]
}
],
"geometry":
{
"type":"Point",
"coordinates":[16.928386702881,51.105440250407]
},
"crs":
{
"type":"name",
"properties":{"name":"urn:ogc:def:crs:OGC:1.3:CRS84"}
}
},
.................... more more more...
I need to put my hands on properties in a list.
So it would be features -> properties -> name_en (list of objects like that)
I try this:
JSONParser parser = new JSONParser();
Object obj = parser.parse(Json_str);
JSONObject jsonObject = (JSONObject) obj;
JSONArray jsonFeaturesArr = new JSONArray(jsonObject.getJSONArray("features"));
in order to create first Json Array, but I can’t even do that. I get error:
The method getJSONArray(String) is undefined for the type JSONObject
(I have the same error for “getJSONObject”). Sth must be missing, I’m a java/android Newbie.
If I solve error how do I go deeper into Json?
Thanx in advance for Help.
try as: