TodayProgramThe weather forecast query function is provided. First, let's take a look:
Initialization interface. query results
This original is from http://www.anddev.org/, I think it is an error, data is obtained through Google weather API, for example, we enter the following in the browser: http://www.google.com/ig/api? Weather = Hangzhou: The result is XML data (you only need to change the value after "=" to the desired city name for Different queries. It seems that Chinese characters are not supported and only Pinyin is supported ). as shown in:
We use saxparser. Parse the obtained data. Of course, this step is important. If you want to see more details, click the following link:
Http://www.anddev.org/android_weather_forecast_-_google_weather_api_-_description-t337.html
However, this tutorialSource codeIf there is a problem, it cannot run. I modified it and asked it to support Chinese queries. If you need the source code, please leave your email and I will send it to you as soon as possible. Thx ~
SourceCode: Weatherforcastdemo