Hi ,
I am trying to parse this json structure but am unable to do this ;
{
"fruits":
[
{
"apple":
{
"number":20,
"calories":"210",
"Sweet":"yes",
"Sour":"yes",
"Juice":"yes",
"Pickle":"No"
}
},
{
"Grape":
{
"number":10,
"calories":"200",
"Sweet":"yes",
"Sour":"yes",
"Juice":"yes",
"Pickle":"No"
}
},
{
"Banana":
{
"number":80,
"calories":"100",
"Sweet":"yes",
"Sour":"yes",
"Juice":"yes",
"Pickle":"yes"
}
},
]
}
Here is my code :
jsonObject = new JSONObject(exteradata);
JSONArray cities = jsonObject.getJSONArray("cities");
String json = cities.toString();
String str = json;
char[] arr = str.toCharArray();
for (char c : arr)
-
.
.
.
.
Even though I am getting the individual characters from json structure
like {,",",c,i,t,i,e,s, from this code --> for (char c : arr) but
actually i want to fetch the individual attribute of the json string .
Does anyone have good link /idea to implement this.I have googled enough.
Thanks in advance.
Rgds,
Saurabh
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en