使用google的weather api可以得到天气的xml文件,如下链接
http://www.google.com/ig/api?weather=,,,31174165,121433841
但是现在我想知道里面所有的天气种类,找了很久,都没找到
目前知道的有Clear,Partly Sunny,storm,frog等
谁能告诉我有哪些,或者告诉我去哪里可以找到,谢谢
http://www.google.com/ig/api?weather=,,,31174165,121433841
但是现在我想知道里面所有的天气种类,找了很久,都没找到
目前知道的有Clear,Partly Sunny,storm,frog等
谁能告诉我有哪些,或者告诉我去哪里可以找到,谢谢
解决方案 »
- 求关注:关于使用Android API文档的问题
- 菜单Menu里“退出”按钮的代码问题,求解决!谢谢!
- android切换activity的小程序: TextView未在main.xml中声明,而是用new来写的TextView为什么会影响程序运行?
- 请问执行createBindMounts()函数时用到的/mnt/secure/staging/android_secure目录是何时创建的?
- mediaplayer播放网络上的媒体文件
- goLauncher的各种动画特效有人在研究吗?
- 获取积分真难
- 【安卓求助】demo例子移植到新项目一直报错。
- fragment和蓝牙的问题
- ListView现实问题求帮助
- 如是实现 将一个自定义view整体放大缩小
- android 内存管理求教
<xml_api_reply version="1"><weather module_id="0" tab_id="0" mobile_row="0" mobile_zipped="1" row="0" section="0"><forecast_information><city data="Beijing, Beijing"/><postal_code data="Beijing"/><latitude_e6 data=""/><longitude_e6 data=""/><forecast_date data="2011-06-09"/><current_date_time data="2011-06-09 14:30:00 +0000"/><unit_system data="SI"/></forecast_information><current_conditions><condition data="晴"/><temp_f data="75"/><temp_c data="24"/><humidity data="湿度: 73%"/><icon data="/ig/images/weather/sunny.gif"/><wind_condition data="风向: 北、风速:1 米/秒"/></current_conditions><forecast_conditions><day_of_week data="周四"/><low data="21"/><high data="35"/><icon data="/ig/images/weather/mostly_sunny.gif"/><condition data="晴间多云"/></forecast_conditions><forecast_conditions><day_of_week data="周五"/><low data="18"/><high data="32"/><icon data="/ig/images/weather/mostly_sunny.gif"/><condition data="以晴为主"/></forecast_conditions><forecast_conditions><day_of_week data="周六"/><low data="18"/><high data="32"/><icon data="/ig/images/weather/sunny.gif"/><condition data="晴"/></forecast_conditions><forecast_conditions><day_of_week data="周日"/><low data="19"/><high data="35"/><icon data="/ig/images/weather/sunny.gif"/><condition data="晴"/></forecast_conditions></weather></xml_api_reply>
这是我自己写的,也是楼主这个url返回的天气情况
if (current.getCondition().equals("晴") ||
current.getCondition().equals("以晴为主") ||
current.getCondition().equals("晴间多云") ||
current.getCondition().equals("Clear") ||
current.getCondition().equals("Sunny") ||
current.getCondition().equals("Mostly Sunny") ||
current.getCondition().equals("Partly Sunny") ||
current.getCondition().equals("Fine")) {
mWeatherIconFlg = WEATHER_FINE;
} else if (current.getCondition().equals("多云") ||
current.getCondition().equals("局部多云") ||
current.getCondition().equals("Mostly Cloudy") ||
current.getCondition().equals("Partly Cloudy") ||
current.getCondition().equals("Cloudy")) {
mWeatherIconFlg = WEATHER_CLOUD;
} else if (current.getCondition().equals("雾霾") ||
current.getCondition().equals("烟雾") ||
current.getCondition().equals("Smoke") ||
current.getCondition().equals("Haze")) {
mWeatherIconFlg = WEATHER_HAZE;
} else if (current.getCondition().equals("阴") ||
current.getCondition().equals("Overcast")) {
mWeatherIconFlg = WEATHER_YIN;
} else if (current.getCondition().equals("雪") ||
current.getCondition().equals("小雪") ||
current.getCondition().equals("中雪") ||
current.getCondition().equals("大雪") ||
current.getCondition().equals("暴雪") ||
current.getCondition().equals("Light snow") ||
current.getCondition().equals("Snow")) {
mWeatherIconFlg = WEATHER_SNOW;
} else if (current.getCondition().equals("雨夹雪") ||
current.getCondition().equals("Sleet")) {
mWeatherIconFlg = WEATHER_YUJIAXUE;
} else if (current.getCondition().equals("雷阵雨") ||
current.getCondition().equals("Thunderstorm")) {
mWeatherIconFlg = WEATHER_LEIZHENYU;
} else if (current.getCondition().equals("阵雨") ||
current.getCondition().equals("Storm")) {
mWeatherIconFlg = WEATHER_ZHENYU;
} else if (current.getCondition().equals("小雨") ||
current.getCondition().equals("可能有雨") ||
current.getCondition().equals("可能有暴风雨") ||
current.getCondition().equals("Chance of Rain") ||
current.getCondition().equals("Chance of Storm") ||
current.getCondition().equals("Light rain")) {
mWeatherIconFlg = WEATHER_XIAOYU;
} else if (current.getCondition().equals("中雨") ||
current.getCondition().equals("雨") ||
current.getCondition().equals("小到中雨") ||
current.getCondition().equals("Rain") ||
current.getCondition().equals("Moderate rain")) {
mWeatherIconFlg = WEATHER_ZHONGYU;
} else if (current.getCondition().equals("大雨") ||
current.getCondition().equals("中到大雨") ||
current.getCondition().equals("Pour")) {
mWeatherIconFlg = WEATHER_DAYU;
} else if (current.getCondition().equals("暴雨") ||
current.getCondition().equals("大到暴雨") ||
current.getCondition().equals("Rainstorm")) {
mWeatherIconFlg = WEATHER_DAYU;
} else if (current.getCondition().equals("雾") ||
current.getCondition().equals("Fog")) {
mWeatherIconFlg = WEATHER_FOG;
} else {
mWeatherIconFlg = 0;
}
现在贴上来http://www.google.com.hk/ig/images/weather/chance_of_rain.gif
http://www.google.com.hk/ig/images/weather/chance_of_snow.gif
http://www.google.com.hk/ig/images/weather/chance_of_storm.gif
http://www.google.com.hk/ig/images/weather/chance_of_tstorm.gif
http://www.google.com.hk/ig/images/weather/cloudy.gif
http://www.google.com.hk/ig/images/weather/dust.gif
http://www.google.com.hk/ig/images/weather/flurries.gif
http://www.google.com.hk/ig/images/weather/fog.gif
http://www.google.com.hk/ig/images/weather/haze.gif
http://www.google.com.hk/ig/images/weather/icy.gif
http://www.google.com.hk/ig/images/weather/mist.gif
http://www.google.com.hk/ig/images/weather/mostly_cloudy.gif
http://www.google.com.hk/ig/images/weather/mostly_sunny.gif
http://www.google.com.hk/ig/images/weather/partly_cloudy.gif
http://www.google.com.hk/ig/images/weather/rain.gif
http://www.google.com.hk/ig/images/weather/sleet.gif
http://www.google.com.hk/ig/images/weather/smoke.gif
http://www.google.com.hk/ig/images/weather/snow.gif
http://www.google.com.hk/ig/images/weather/storm.gif
http://www.google.com.hk/ig/images/weather/sunny.gif
http://www.google.com.hk/ig/images/weather/thunderstorm.gif
欢迎补充
<type>PARTLY SUNNY</type>
<type>SCATTERED THUNDERSTORMS</type>
<type>SHOWERS</type>
<type>SCATTERED SHOWERS</type>
<type>RAIN AND SNOW</type>
<type>OVERCAST</type>
<type>LIGHT SNOW</type>
<type>FREEZING DRIZZLE</type>
<type>CHANCE OF RAIN</type>
<type>SUNNY</type>
<type>CLEAR</type>
<type>MOSTLY SUNNY</type>
<type>PARTLY CLOUDY</type>
<type>MOSTLY CLOUDY</type>
<type>CHANCE OF STORM</type>
<type>RAIN</type>
<type>CHANCE OF SNOW</type>
<type>CLOUDY</type>
<type>MIST</type>
<type>STORM</type>
<type>THUNDERSTORM</type>
<type>CHANCE OF TSTORM</type>
<type>SLEET</type>
<type>SNOW</type>
<type>ICY</type>
<type>DUST</type>
<type>FOG</type>
<type>SMOKE</type>
<type>HAZE</type>
<type>FLURRIES</type>
<type>LIGHT RAIN</type>
<type>SNOW SHOWERS</type>
<type>ICE/SNOW</type>
<type>WINDY</type>
<type>SCATTERED SNOW SHOWERS</type>
</conditions>没有中文的