最新最全天气预报附带Json解析
来源:互联网 发布:网络问卷调查赚钱 编辑:程序博客网 时间:2024/04/29 22:16
http://wthrcdn.etouch.cn/weather_mini?city=101010100
{"desc":"OK","status":1000,"data":{"wendu":"24","ganmao":"天气转凉,空气湿度较大,较易发生感冒,体质较弱的朋友请注意适当防护。","forecast":[{"fengxiang":"无持续风向","fengli":"微风级","high":"高温 26℃","type":"雷阵雨","low":"低温 18℃","date":"13日星期三"},{"fengxiang":"无持续风向","fengli":"微风级","high":"高温 26℃","type":"阵雨","low":"低温 19℃","date":"14日星期四"},{"fengxiang":"无持续风向","fengli":"微风级","high":"高温 22℃","type":"小到中雨","low":"低温 19℃","date":"15日星期五"},{"fengxiang":"无持续风向","fengli":"微风级","high":"高温 24℃","type":"雷阵雨","low":"低温 16℃","date":"16日星期六"},{"fengxiang":"北风","fengli":"3-4级","high":"高温 24℃","type":"多云","low":"低温 15℃","date":"17日星期天"}],"yesterday":{"fl":"微风","fx":"无持续风向","high":"高温 26℃","type":"雷阵雨","low":"低温 18℃","date":"12日星期二"},"aqi":"81","city":"南昌"}}
{"weatherinfo":{"city":"北京","cityid":"101010100","temp1":"15℃","temp2":"5℃","weather":"多云","img1":"d1.gif","img2":"n1.gif","ptime":"08:00"}}
new Thread() {
public void run() {
try {
Map<String, Object> map = new HashMap<String, Object>();
String str = HttpUtil.doGet(
url1 = "http://www.weather.com.cn/adat/cityinfo/"
+ cityid+ ".html", map);
// 将string转换为jsonobject
JSONObject jsonObject0 = new JSONObject(str);
// 解析jsonobject里面的值
JSONObject jsonObject1 = jsonObject0
.getJSONObject("weatherinfo");
city_ = jsonObject1.getString("city");
cityid_ = jsonObject1.getString("cityid");
temp2_ = jsonObject1.getString("temp2");
temp1_ = jsonObject1.getString("temp1");
weather_ = jsonObject1.getString("weather");
ptime_ = jsonObject1.getString("ptime");
handler.sendEmptyMessage(1)
} catch (Exception e) {
e.printStackTrace();
handler.sendEmptyMessage(2);
}
};
}.start();
0 0
- 最新最全天气预报附带Json解析
- json解析天气预报
- json天气预报解析
- Json解析之天气预报
- Android天气预报(Json解析)
- 网路:JSON 解析(天气预报)
- JSON 解析 网络 上 天气预报
- 最新最全python 镜像源
- 国家气象局天气预报接口JSON完全解析
- Android:国家气象局天气预报接口JSON完全解析
- iOS开发json解析之天气预报
- Android实战--天气预报(API+JSON解析)
- Android天气预报,Json解析,百度天气接口
- android Json解析全
- android Json解析全
- Json数据格式全解析
- JSON全解析
- 天气预报---网络加载最新天气信息,截取JSON文件
- ImageView,Bitmap,Drawable
- 跨列设置column-span
- Android获取手机中外置内存卡、内置内存卡、手机内存路径
- Python Challenge题解 (更新到33关)
- Vi 编辑器常用命令
- 最新最全天气预报附带Json解析
- transform()用法详解
- java web 的jsp的跳转问题
- volatile用在如下的几个地方
- java开发微信第三方平台 模板消息发送消息案例
- 判断一个正整数是否为2的幂
- 一篇关于Android Root不错的文章
- PageMybatisInterceptor 的原理
- 沉浸式状态栏的实现代码