I want to read this JSON
lines but because it start with JSONArray
i'm a little confused
"abridged_cast": [
{
"name": "Jeff Bridges",
"id": "162655890",
"characters": [
"Jack Prescott"
]
},
{
"name": "Charles Grodin",
"id": "162662571",
"characters": [
"Fred Wilson"
]
},
{
"name": "Jessica Lange",
"id": "162653068",
"characters": [
"Dwan"
]
},
{
"name": "John Randolph",
"id": "162691889",
"characters": [
"Capt. Ross"
]
},
{
"name": "Rene Auberjonois",
"id": "162718328",
"characters": [
"Bagley"
]
}
],
i just need to use the "name" and save all as one String. (the string value will be : Jeff Bridges,Charles Grodin,Jessica Lange,John Randolph,Rene Auberjonois).
this is my code:
try {
//JSON is the JSON code above
JSONObject jsonResponse = new JSONObject(JSON);
JSONArray movies = jsonResponse.getJSONArray("characters");
String hey = movies.toString();
} catch (JSONException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}