2012-05-26 64 views
-1

所以我想開發一個應用程序,讓你看到目前的天氣怎麼樣 機構AccuWeather等等天氣數據庫

,但我不能找到一個數據庫,以獲得當前的天氣數據

所以請如果你們任何人知道wheere讓他們回答

+2

您有試過Google天氣API的嗎? –

+0

嘗試搜索「天氣api」而不是「天氣數據庫」。除谷歌和雅虎之外,還有Weather Underground:http://www.wunderground.com/weather/api/ –

+0

[Weather API for Android]的可能重複(http://stackoverflow.com/questions/5307831/weather -apis-for-android) –

回答

0

這裏的雅虎API

http://weather.yahooapis.com/forecastrss?w=1940631&u=c 

,讓天氣和u要分析它

0

我已經使用了iGoogle。您將需要實現一個XML解析器。 我用它作爲一個Java程序如下:

URL googleweatherapi = new URL("http://www.google.com/ig/api?weather=$" + city); 

這是在得到正確的位置... 20%在城市可變空間通常好;

String city = "New%20York"; 
+1

可能最好使用[URLEncoder]進行編碼(http://developer.android.com/reference/java/net/URLEncoder.html)。在這種情況下,它將是'URLEncoder.encode(「New York」,「utf-8」);' –