Android中的JSONObject和JSONArray解析json数据
2013-01-07 17:49
507 查看
{"students": [{"name":"Jack","age":12}, {"name":"Vista","age":23}, {"name":"Kaka","age":22}, {"name":"Hony","age":31}]}
try { JSONObject jo = new JSONObject(strJson); JSONArray jsonArray = (JSONArray) jo.get("students"); for (int i = 0; i < jsonArray.length(); ++i) { JSONObject o = (JSONObject) jsonArray.get(i); System.out.println("name:" + o.getString("name") + "," + "age:" + o.getInt("age")); } } catch (JSONException e) { e.printStackTrace(); }
相关文章推荐
- json 的解析-使用Android中的JSONObject和JSONArray解析json数据,gson中的JsonReader解析json数据
- json 的解析-使用Android中的JSONObject和JSONArray解析json数据
- android用JSONObject和JSONArray解析json格式数据
- 利用android自带的JSONObject解析json数据
- android中用jsonObject解析json数据
- org.JSONObeject,org.JSONArray,net.sf.JSONObject方法的使用,用java解析json数据的方法
- 【android】利用volley+Gson POST json请求来接收jsonObject并解析json数据
- android 读取JSON数据(遍历JSONObject和JSONArray)
- android 读取json数据(遍历JSONObject和JSONArray)
- Android开发: JSONObject的数据解析
- android中用jsonObject解析json数据
- android 读取JSON数据(遍历JSONObject和JSONArray)
- android 读取JSON数据(遍历JSONObject和JSONArray)
- android 读取json数据(遍历JSONObject和JSONArray
- 解析一个数组JsonArray下有多种数据类型JsonObject的Json
- android 读取json数据(遍历JSONObject和JSONArray
- Android JSON 数据里面 嵌套了JSONObject对象,怎么解析成Bean实体?
- android中用jsonObject解析json数据
- Android使用自带JSONObject解析JSON数据
- android 学习笔记 解析json格式的数据 JSONObject 和GSON解析json格式数据