android json 处理
来源:互联网 发布:anaconda 包含python 编辑:程序博客网 时间:2024/05/24 06:40
String strJson = "{"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();
}
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();
}
0 0
- android json 处理
- android json处理
- Android Json处理框架
- Android关于JSON的处理
- Android - 网络编程 - JSON - 处理
- Android中处理Json数据
- Android Json处理之Gson
- Android处理错误json数据
- android Json处理换行符
- Android 下json处理字符串处理
- android中处理json最佳方法
- Android用GSon处理Json数据
- Android用GSon处理Json数据
- Android用GSon处理Json数据
- android利用http请求json处理
- android中处理json最佳方法
- Android用GSon处理Json数据
- android中json数据的处理
- Adapter的继承结构
- ZeroMQ之消息丢失解决方法
- java + selenium测试框架 版本演化一
- openwrt在7620A上对fat格式U盘的支持
- bzero
- android json 处理
- 编程珠玑(第二版)读书笔记第一章
- LeetCode:Reverse Words in a String
- MFC对话框水平和垂直滚动条功能
- java--程序运行时出现内存溢出
- flip_close Oops问题排查
- libgdx3D第一讲-基础教程
- 配置mysql最大允许插入数据大小(max_allowed_packet)
- 包图+设计模式?