0
我正在探索新的Google Awareness API,更確切地說就是「獲取天氣」API。不可靠Google Awarness天氣API
https://developers.google.com/awareness/android-api/snapshot-get-data#get_weather
是好幾天,我正在測試,我注意到兩個問題:
- INT [] getConditions()總是返回,而不是「一個2元的單一元素條件, int數組「就像文檔報告一樣;
- 這種情況通常很不準確。
當然,我嘗試了與世界各地不同的位置(嘲笑我的位置),比較它與其他天氣服務,結果是相同的。
那是因爲他們只是釋放它嗎?還是因爲我做錯了什麼?這是我的代碼:「返回當前的天氣條件,最能說明當前條件值的數組」
Awareness.SnapshotApi.getWeather(client)
.setResultCallback(new ResultCallback<WeatherResult>() {
@Override
public void onResult(@NonNull WeatherResult weatherResult) {
// weatherResult.getWeather().getConditions() contains the weather condition
}
});