{ "name_A" : "value_A","name_B" : "value_B" }
name_A = value_A; name_B = value_B;
[{"id":"5","version":"5.5","name":"愤怒的小鸟"},
{"id":"6","version":"7.0","name":"神庙逃亡"},
{"id":"7","version":"3.5","name":"保卫萝卜"}]
private void parseJSONWithJSONObject(String jsonData) {
try {
JSONArray jsonArray = new JSONArray(jsonData);
for (int i = 0; i < jsonArray.length(); i++) {
JSONObject jsonObject = jsonArray.getJSONObject(i);
String id = jsonObject.getString("id");
String name = jsonObject.getString("name");
String version = jsonObject.getString("version");
Log.d("woider", "id is " + id);
Log.d("woider", "name is " + name);
Log.d("woider", "version is " + version);
}
} catch (Exception e) {
e.printStackTrace();
}
}
JSONArray jsonArray = new JSONArray(jsonData);
JSONObject jsonObject = jsonArray.getJSONObject(index);
String name = jsonObject.getString("name");
private void parseJSONWithGSON(String jsonData) {
Gson gson = new Gson();
List<App> appList = gson.fromJson(jsonData, new TypeToken<List<App>>() {
}.getType());
for (App app : appList) {
Log.d("woider", "id is " + app.getId());
Log.d("woider", "name is " + app.getName());
Log.d("woider", "version is " + app.getVersion());
}
}
机械节能产品生产企业官网模板...
大气智能家居家具装修装饰类企业通用网站模板...
礼品公司网站模板
宽屏简约大气婚纱摄影影楼模板...
蓝白WAP手机综合医院类整站源码(独立后台)...苏ICP备2024110244号-2 苏公网安备32050702011978号 增值电信业务经营许可证编号:苏B2-20251499 | Copyright 2018 - 2025 源码网商城 (www.ymwmall.com) 版权所有