JSONArray cities = json.getJSONArray("city");
With the above code got the following output:
{
"id":"1",
"name":"London"
"country":"United Kingdom"
},
{
"id":"2",
"name":"Madrid"
"country":"Spain"
},
{"id":"3",
"name":"Paris"
"country":"France"
},
{
"id":"3",
"name":"Zurich"
"country":"Switzerland"
}
How can I get only the name from the JSON array to a string array?
e.g.: String[] s ={"London","Madrid","Paris","Zurich"}