当前位置:  编程技术>移动开发

android调用国家气象局天气预报接口json数据格式解释

    来源: 互联网  发布时间:2014-10-22

    本文导语:  国家气象局提供了三种数据的形式 网址在: http://www.weather.com.cn/data/sk/101010100.html http://www.weather.com.cn/data/cityinfo/101010100.html http://m.weather.com.cn/data/101010100.html 最后一种是解析最全面的。 数据解析格式: 第一个网址提供的json数...

国家气象局提供了三种数据的形式

网址在:

http://www.weather.com.cn/data/sk/101010100.html

http://www.weather.com.cn/data/cityinfo/101010100.html

http://m.weather.com.cn/data/101010100.html

最后一种是解析最全面的。

数据解析格式:

第一个网址提供的json数据为:

代码如下:

{"weatherinfo":{"city":"北京","cityid":"101010100","temp":"-2","WD":"西北风","WS":"3级","SD":"241%","WSE":"3","time":"10:61","isRadar":"1","Radar":"JC_RADAR_AZ9010_JB"}}

第二个网址提供的json数据为:

代码如下:

{"weatherinfo":{"city":"北京","cityid":"101010100","temp1":"3℃","temp2":"-8℃","weather":"晴","img1":"d0.gif","img2":"n0.gif","ptime":"11:00"}}

第三个网址提供的json数据较为全面:

代码如下:

{
    "weatherinfo":
        {
            "city":"北京",
            "city_en":"beijing",
            "date_y":"2013年1月17日",
            "date":"",
            "week":"星期四",
            "fchh":"11",
            "cityid":"101010100",
            "temp1":"3℃~-8℃",
            "temp2":"3℃~-5℃",
            "temp3":"3℃~-3℃",
            "temp4":"1℃~-5℃",
            "temp5":"3℃~-6℃",
            "temp6":"2℃~-5℃",
            "tempF1":"37.4℉~17.6℉",
            "tempF2":"37.4℉~23℉",
            "tempF3":"37.4℉~26.6℉",
            "tempF4":"33.8℉~23℉",
            "tempF5":"37.4℉~21.2℉",
            "tempF6":"35.6℉~23℉",
            "weather1":"晴",
            "weather2":"晴",
            "weather3":"多云转阴",
            "weather4":"阴转多云",
            "weather5":"多云转晴",
            "weather6":"晴转多云",
            "img1":"0",
            "img2":"99",
            "img3":"0",
            "img4":"99",
            "img5":"1",
            "img6":"2",
            "img7":"2",
            "img8":"1",
            "img9":"1",
            "img10":"0",
            "img11":"0",
            "img12":"1",
            "img_single":"0",
            "img_title1":"晴",
            "img_title2":"晴",
            "img_title3":"晴",
            "img_title4":"晴",
            "img_title5":"多云",
            "img_title6":"阴",
            "img_title7":"阴",
            "img_title8":"多云",
            "img_title9":"多云",
            "img_title10":"晴",
            "img_title11":"晴",
            "img_title12":"多云",
            "img_title_single":"晴",
            "wind1":"微风",
            "wind2":"微风",
            "wind3":"微风",
            "wind4":"微风",
            "wind5":"微风",
            "wind6":"微风",
            "fx1":"微风",
            "fx2":"微风",
            "fl1":"小于3级",
            "fl2":"小于3级",
            "fl3":"小于3级",
            "fl4":"小于3级",
            "fl5":"小于3级",
            "fl6":"小于3级",
            "index":"冷",
            "index_d":"天气冷,建议着棉衣、皮夹克加羊毛衫等冬季服装。年老体弱者宜着厚棉衣或冬大衣。",
            "index48":"冷",
            "index48_d":"天气冷,建议着棉衣、皮夹克加羊毛衫等冬季服装。年老体弱者宜着厚棉衣或冬大衣。",
            "index_uv":"弱",
            "index48_uv":"弱",
            "index_xc":"适宜",
            "index_tr":"较适宜",
            "index_co":"较不舒适",
            "st1":"2",
            "st2":"-6",
            "st3":"2",
            "st4":"-3",
            "st5":"3",
            "st6":"-4",
            "index_cl":"适宜",
            "index_ls":"基本适宜",
            "index_ag":"极不易发"
            }
}

详细解析格式如下:

以json格式提供,格式如下

代码如下:

{"weatherinfo":{

//基本信息;

"city":"北京","city_en":"beijing",

"date_y":"2013年1月17日","date":"辛卯年","week":"星期三","fchh":"18","cityid":"101010100",

//摄氏温度

"temp1":"24℃~33℃","temp2":"24℃~32℃","temp3":"25℃~31℃","temp4":"23℃~30℃","temp5":"22℃~30℃","temp6":"21℃~32℃",

//华氏温度;

"tempF1":"75.2℉~91.4℉","tempF2":"75.2℉~89.6℉","tempF3":"77℉~87.8℉","tempF4":"73.4℉~86℉","tempF5":"71.6℉~86℉","tempF6":"69.8℉~89.6℉",

//天气描述;

"weather1":"多云","weather2":"晴转多云","weather3":"阴","weather4":"晴转阵雨","weather5":"阵雨","weather6":"多云",

//天气描述图片序号

"img1":"1","img2":"99","img3":"0","img4":"1","img5":"2","img6":"99","img7":"0","img8":"3","img9":"3","img10":"99","img11":"1","img12":"99",

"img_single":"1",

//图片名称;

"img_title1":"多云","img_title2":"多云","img_title3":"晴","img_title4":"多云","img_title5":"阴","img_title6":"阴","img_title7":"晴","img_title8":"阵雨","img_title9":"阵雨","img_title10":"阵雨","img_title11":"多云","img_title12":"多云","img_title_single":"多云",

//风速描述

"wind1":"微风","wind2":"微风","wind3":"微风","wind4":"微风","wind5":"微风","wind6":"微风",

//???

"fx1":"微风","fx2":"微风","fl1":"小于3级","fl2":"小于3级","fl3":"小于3级","fl4":"小于3级","fl5":"小于3级","fl6":"小于3级",

//今天穿衣指数;

"index":"炎热","index_d":"天气炎热,建议着短衫、短裙、短裤、薄型T恤衫、敞领短袖棉衫等清凉夏季服装。",

//48小时穿衣指数

"index48":"炎热","index48_d":"天气炎热,建议着短衫、短裙、短裤、薄型T恤衫、敞领短袖棉衫等清凉夏季服装。"

//紫外线及48小时紫外线

,"index_uv":"中等","index48_uv":"弱",

//洗车

"index_xc":"适宜",

//旅游

"index_tr":"较适宜",

//舒适指数

"index_co":"较不舒适",

//

"st1":"33","st2":"24","st3":"32","st4":"25","st5":"32","st6":"24",

//晨练

"index_cl":"适宜",

//晾晒

"index_ls":"适宜",

//过敏

"index_ag":"极易发"}}

字段言简意赅,城市名,英文名,日期,农历日期,星期,预报时间,城市代码,6个预报温度(华氏温度,摄氏温度),6个预报天气和风力,剩下的就是一些气象指数。


    
 
 

您可能感兴趣的文章:

  • 开发android应用程序时,用java调用so库输出日志问题
  • Android调用系统时间格式显示时间信息
  • android 触屏的震动响应接口调用方法
  • android 能调用vc写好的静态库lib或者动态库DLL么?
  • Android调用默认浏览器打开指定Url的方法实例
  • Android调用google地图生成路线图实现代码
  • Android应用内调用第三方应用的方法
  • android 调用系统的照相机和图库实例详解
  • 通过Html网页调用本地安卓(android)app程序代码
  • Android调用系统的发邮件功能的小例子
  • android动态壁纸调用的简单实例
  • Android 四种动画效果的调用实现代码
  • Android开发中怎样调用系统Email发送邮件(多种调用方式)
  • android 微信 sdk api调用不成功解决方案
  • Android调用相机并将照片存储到sd卡上实现方法
  • android中可以通过两种方式调用接口发送短信
  • android monkey自动化测试改为java调用monkeyrunner Api
  • android中soap协议使用(ksoap调用webservice)
  • android开发之调用手机的摄像头使用MediaRecorder录像并播放
  • Android 使用【AIDL】调用外部服务的解决方法
  • Android 四种动画效果的调用实现代码 iis7站长之家
  •  
    本站(WWW.)旨在分享和传播互联网科技相关的资讯和技术,将尽最大努力为读者提供更好的信息聚合和浏览方式。
    本站(WWW.)站内文章除注明原创外,均为转载、整理或搜集自网络。欢迎任何形式的转载,转载请注明出处。












  • 相关文章推荐
  • 申请Android Map 的API Key(v2)的最新申请方式(SHA1密钥)
  • Android瀑布流实例 android_waterfall
  • Android开发需要的几点注意事项总结
  • Android系统自带样式 (android:theme)
  • android 4.0 托管进程介绍及优先级和回收机制
  • Android网络共享软件 Android Wifi Tether
  • Android访问与手机通讯相关类的介绍
  • Android 图标库 Android GraphView
  • Android及andriod无线网络Wifi开发的几点注意事项
  • 轻量级Android开发工具 Android Tools
  • Android 2.3 下StrictMode介绍
  • Android 开发环境 Android Studio
  • IDEA的Android开发插件 idea-android
  • Android手机事件提醒 Android Notifier
  • XBMC的Android客户端 android-xbmcremote
  • Android小游戏 Android Shapes
  • Android电池监控 Android Battery Dog
  • android开发:“android:WindowTitle”没有对应项no resource
  • Android 上类似IOS 的开关控件。 Android ToggleButton
  • Android 将 android view 的位置设为右下角的解决方法
  • Android 2D游戏引擎 Android Angle


  • 站内导航:


    特别声明:169IT网站部分信息来自互联网,如果侵犯您的权利,请及时告知,本站将立即删除!

    ©2012-2021,,E-mail:www_#163.com(请将#改为@)

    浙ICP备11055608号-3