一个JSON
解析:
一组JSON
String value={
"thumb_exists": false,
"bytes": 579538,
"modified": "Tue, 04 Nov 2008 02:52:28 +0000",
"path": "/Public/aim_guide.pdf",
"is_dir": false,
"size": "566.0KB",
"root": "dropbox",
"icon": "page_white_acrobat"
}
解析:
JSONObject jo=new JSONObject(value);
jo.getString("thumb_exists");
jo.getString("bytes");
...
一组JSON
values="[{'latitude':116.40091896057129,'longitude':39.931129903495886},
{'latitude':116.40194892883301,'longitude':39.946134395563796},
{'latitude':116.39645576477051,'longitude':39.95488549657055}]"
JSONArray ja = new JSONArray(values);
for (int i = 0; i < ja.length(); i++) {
JSONObject jo = ja.getJSONObject(i);
//与解析单个JSON一样
}