问题描述
- 问个android json解析问题 麻烦大牛回答一下 谢谢!
-
{
"code": 200,
"datas": {
"banner_info": [
{
"pic_name": "冬季名品-大牌季节日",
"phone_pic_img": ""
},
{
"pic_name": "全套茶具专场-年终盛典",
"phone_pic_img": ""
},
{
"pic_name": "女人再忙也要留一天为自己疯抢",
"phone_pic_img": ""
},
{
"pic_name": "全年爆款-年底清仓",
"phone_pic_img": ""
},
{
"pic_name": "清仓年末特优-满99元包邮",
"phone_pic_img": ""
}
],
"hot_info": [
{
"goods_id": "231",
"market_price": "1688.00",
"goods_name": "至尊金奖 法国原瓶进口AOC红酒 任选一箱 红沙城堡红葡萄酒 原装进口",
"goods_price": "899.00",
"goods_pic": "http://192.168.0.199:8081/data/upload/shop/store/goods/1/1_04423392298369303_240.jpg"
},
{
"goods_id": "232",
"market_price": "168.00",
"goods_name": "中华老字号 东阿阿胶桃花姬阿胶糕300g",
"goods_price": "150.00",
"goods_pic": "http://192.168.0.199:8081/data/upload/shop/store/goods/1/1_04423411880302392_240.png"
},
{
"goods_id": "53",
"market_price": "483.00",
"goods_name": "新款 女款 拼接 不规则摆 长袖针织衫开衫 杏雨 紫色",
"goods_price": "99.00",
"goods_pic": "http://192.168.0.199:8081/data/upload/shop/store/goods/1/1_04418254088878407_240.jpg"
},
{
"goods_id": "49",
"market_price": "358.00",
"goods_name": "春装 披肩式 超短款 针织 衫开衫 女装 青鸟 黑色",
"goods_price": "129.00",
"goods_pic": "http://192.168.0.199:8081/data/upload/shop/store/goods/1/1_04418240955916042_240.jpg"
},
{
"goods_id": "48",
"market_price": "358.00",
"goods_name": "春装 披肩式 超短款 针织 衫开衫 女装 青鸟 蓝色",
"goods_price": "129.00",
"goods_pic": "http://192.168.0.199:8081/data/upload/shop/store/goods/1/1_04418240795665638_240.jpg"
}
],
"class_info": []
}
}这个该怎么解析? 谢谢!!!
解决方案
public class Object
{
private int code;
private Datas datas;
private class Datas
{
private List<Banners> banner_info;
private List<Hots> hot_info;
private List<ClassInfos> class_info;
}
private class Banners
{
private String pic_name;
private String phone_pic_img;
}
private class Hots
{
private String goods_id;
private String market_price;
private String goods_name;
private String goods_price;
private String goods_pic;
}
private class ClassInfos
{
……
}
}
解决方案二:
http://www.iteye.com/problems/77911
解决方案三:
你用gson解析,到一个包,封装实体类 ,就好了
解决方案四:
麻烦各位回答我的这个问题 谢了。。谢了。。谢了。。。
时间: 2024-11-01 06:11:04