开发者社区> 问答> 正文

像这种json数据用Gson解析是否合适,如果不合适的话,用什么比较合适。

 {
    "resultcode": "200",
    "reason": "查询成功!",
    "result": {
        "sk": { /*当前实况天气*/
            "temp": "21",   /*当前温度*/
            "wind_direction": "西风", /*当前风向*/
            "wind_strength": "2级",    /*当前风力*/    
            "humidity": "4%",   /*当前湿度*/
            "time": "14:25" /*更新时间*/
        },
        "today": {
            "city": "天津",
            "date_y": "2014年03月21日",
            "week": "星期五",
            "temperature": "8℃~20℃",    /*今日温度*/
            "weather": "晴转霾", /*今日天气*/
            "weather_id": { /*天气唯一标识*/
                "fa": "00", /*天气标识00:晴*/
                "fb": "53"  /*天气标识53:霾 如果fa不等于fb,说明是组合天气*/
            },
            "wind": "西南风微风",
            "dressing_index": "较冷", /*穿衣指数*/
            "dressing_advice": "建议着大衣、呢外套加毛衣、卫衣等服装。", /*穿衣建议*/
            "uv_index": "中等",   /*紫外线强度*/
            "comfort_index": "",/*舒适度指数*/
            "wash_index": "较适宜",  /*洗车指数*/
            "travel_index": "适宜",   /*旅游指数*/
            "exercise_index": "较适宜",  /*晨练指数*/
            "drying_index": ""/*干燥指数*/
        },
        "future": [ /*未来几天天气*/
            {
                "temperature": "28℃~36℃",
                "weather": "晴转多云",
                "weather_id": {
                    "fa": "00",
                    "fb": "01"
                },
                "wind": "南风3-4级",
                "week": "星期一",
                "date": "20140804"
            },
            {
                "temperature": "28℃~36℃",
                "weather": "晴转多云",
                "weather_id": {
                    "fa": "00",
                    "fb": "01"
                },
                "wind": "东南风3-4级",
                "week": "星期二",
                "date": "20140805"
            },
            {
                "temperature": "27℃~35℃",
                "weather": "晴转多云",
                "weather_id": {
                    "fa": "00",
                    "fb": "01"
                },
                "wind": "东南风3-4级",
                "week": "星期三",
                "date": "20140806"
            },
            {
                "temperature": "27℃~34℃",
                "weather": "多云",
                "weather_id": {
                    "fa": "01",
                    "fb": "01"
                },
                "wind": "东南风3-4级",
                "week": "星期四",
                "date": "20140807"
            },
            {
                "temperature": "27℃~33℃",
                "weather": "多云",
                "weather_id": {
                    "fa": "01",
                    "fb": "01"
                },
                "wind": "东北风4-5级",
                "week": "星期五",
                "date": "20140808"
            },
            {
                "temperature": "26℃~33℃",
                "weather": "多云",
                "weather_id": {
                    "fa": "01",
                    "fb": "01"
                },
                "wind": "北风4-5级",
                "week": "星期六",
                "date": "20140809"
            },
            {
                "temperature": "26℃~33℃",
                "weather": "多云",
                "weather_id": {
                    "fa": "01",
                    "fb": "01"
                },
                "wind": "北风4-5级",
                "week": "星期日",
                "date": "20140810"
            }
        ]
    },
    "error_code": 0
}

展开
收起
爵霸 2016-06-12 11:20:55 2340 0
1 条回答
写回答
取消 提交回答
  • 这是标准的json格式,gson可以处理的,使用其他框架也可以,看你喜欢哪个

    2019-07-17 19:33:34
    赞同 1 展开评论 打赏
问答排行榜
最热
最新

相关电子书

更多
神龙云服务器产品及技术深度解析 立即下载
弹性创造价值:基于ECS的最佳性价比实践解析 立即下载
又快又稳:阿里云下一代虚拟交换机解析 立即下载

相关镜像