zoukankan      html  css  js  c++  java
  • Android 车联网天气

    学友资料:http://www.cnblogs.com/NeilLing/p/4263267.html

    天气查询http://developer.baidu.com/map/index.php?title=car/api/weather

    http://api.map.baidu.com/telematics/v3/weather?location=%E8%8B%8F%E5%B7%9E&output=json&ak=640f3985a6437dad8135dae98d775a09

    {
    "error": 0,
    "status": "success",
    "date": "2015-01-19",
    "results": [
    {
    "currentCity": "苏州",
    "pm25": "167",
    "index": [],
    "weather_data": [
    {
    "date": "周一 01月19日 (实时:8℃)",
    "dayPictureUrl": "http://api.map.baidu.com/images/weather/day/qing.png",
    "nightPictureUrl": "http://api.map.baidu.com/images/weather/night/duoyun.png",
    "weather": "晴转多云",
    "wind": "北风3-4级",
    "temperature": "10 ~ 3℃"
    },
    {
    "date": "周二",
    "dayPictureUrl": "http://api.map.baidu.com/images/weather/day/yin.png",
    "nightPictureUrl": "http://api.map.baidu.com/images/weather/night/yin.png",
    "weather": "阴",
    "wind": "东南风3-4级",
    "temperature": "10 ~ 5℃"
    },
    {
    "date": "周三",
    "dayPictureUrl": "http://api.map.baidu.com/images/weather/day/yin.png",
    "nightPictureUrl": "http://api.map.baidu.com/images/weather/night/duoyun.png",
    "weather": "阴转多云",
    "wind": "西风4-5级",
    "temperature": "11 ~ 1℃"
    },
    {
    "date": "周四",
    "dayPictureUrl": "http://api.map.baidu.com/images/weather/day/qing.png",
    "nightPictureUrl": "http://api.map.baidu.com/images/weather/night/duoyun.png",
    "weather": "晴转多云",
    "wind": "西北风4-5级",
    "temperature": "8 ~ 1℃"
    }
    ]
    }
    ]
    }

    http://api.map.baidu.com/telematics/v3/weather?location=%E8%8B%8F%E5%B7%9E&output=xml&ak=640f3985a6437dad8135dae98d775a09

    <CityWeatherResponse>
    <error>0</error>
    <status>success</status>
    <date>2015-01-19</date>
    <results>
    <currentCity>苏州</currentCity>
    <weather_data>
    <date>周一 01月19日 (实时:8℃)</date>
    <dayPictureUrl>
    http://api.map.baidu.com/images/weather/day/qing.png
    </dayPictureUrl>
    <nightPictureUrl>
    http://api.map.baidu.com/images/weather/night/duoyun.png
    </nightPictureUrl>
    <weather>晴转多云</weather>
    <wind>北风3-4级</wind>
    <temperature>10 ~ 3℃</temperature>
    <date>周二</date>
    <dayPictureUrl>
    http://api.map.baidu.com/images/weather/day/yin.png
    </dayPictureUrl>
    <nightPictureUrl>
    http://api.map.baidu.com/images/weather/night/yin.png
    </nightPictureUrl>
    <weather></weather>
    <wind>东南风3-4级</wind>
    <temperature>10 ~ 5℃</temperature>
    <date>周三</date>
    <dayPictureUrl>
    http://api.map.baidu.com/images/weather/day/yin.png
    </dayPictureUrl>
    <nightPictureUrl>
    http://api.map.baidu.com/images/weather/night/duoyun.png
    </nightPictureUrl>
    <weather>阴转多云</weather>
    <wind>西风4-5级</wind>
    <temperature>11 ~ 1℃</temperature>
    <date>周四</date>
    <dayPictureUrl>
    http://api.map.baidu.com/images/weather/day/qing.png
    </dayPictureUrl>
    <nightPictureUrl>
    http://api.map.baidu.com/images/weather/night/duoyun.png
    </nightPictureUrl>
    <weather>晴转多云</weather>
    <wind>西北风4-5级</wind>
    <temperature>8 ~ 1℃</temperature>
    </weather_data>
    <index></index>
    <pm25>167</pm25>
    </results>
    </CityWeatherResponse>

    学员资料:

    在网上找到一个更详细的天气信息

    http://wthrcdn.etouch.cn/weather_mini?city=深圳
    通过城市名字获得天气数据,json数据
    http://wthrcdn.etouch.cn/weather_mini?citykey=101280601
    通过城市id获得天气数据,json数据

    http://wthrcdn.etouch.cn/WeatherApi?citykey=101280601
    通过城市id获得天气数据,xml文件数据,
    当错误时会有<error>节点
    http://wthrcdn.etouch.cn/WeatherApi?city=深圳
    通过城市名字获得天气数据,xml文件数据

                              作者:xubuhang                出处:http://www.cnblogs.com/xubuhang/ 本文版权归作者和博客园共有,欢迎转载,但未经作者同意必须保留此段声明,且在文章页面明显位置给出原文连接,否则保留追究法律责任的权利。 

     
查看全文
  • 相关阅读:
    迭代器简介
    关于判断对象是否相等的问题
    NIO
    BIO流分类介绍
    servlet简介
    http协议简介
    爬虫常用链接
    http和https协议
    爬虫的合法性研究
    爬虫介绍
  • 原文地址:https://www.cnblogs.com/xubuhang/p/4233150.html
  • Copyright © 2011-2022 走看看