当前位置: 代码迷 >> Android >> 安卓新手 json数据解析有关问题
  详细解决方案

安卓新手 json数据解析有关问题

热度:93   发布时间:2016-04-28 03:48:52.0
安卓新手 json数据解析问题
{"weather":[{"city_name":"北京","city_id":"CHBJ000000","last_update":"2014-11-03T09:44:36+08:00","now":{"text":"晴","code":"0","temperature":"12","feels_like":null,"wind_direction":null,"wind_speed":null,"wind_scale":"","humidity":null,"visibility":null,"pressure":null,"pressure_rising":null,"air_quality":null},"today":{"sunrise":null,"sunset":null,"suggestion":null},"future":[{"date":"2014-11-03","day":"周一","text":"晴","code1":"0","code2":"0","high":"17","low":"3","cop":"0%","wind":"微风小于3级"}]}]}

求各位大神指点  这个数据如何解析
JSONObject object = new JSONObject(sbuf);          //sbuf就是这个数据
JSONObject data = (JSONObject) object.getJSONObject("weather");      用这个报错说要用JSONARRAY
但是小弟看懵了,看不太懂它的Array所在。求大神详解
------解决思路----------------------
其实用JSONObject和JSONArray已经很方便了,没有必要再引入第三方库。
  相关解决方案