| Openweathermap | Yes |
| Weatherunderground Weather.com |
Yes |
| Yahoo! Weather | Yes |
| Forecast.io | Yes |
| Openweathermap | Yes |
| Weatherunderground Weather.com |
Yes |
| Yahoo! Weather | Yes |
| Forecast.io | Yes |
weatherClient.getForecastWeather(new WeatherRequest(cityId), new WeatherClient.ForecastWeatherEventListener() {
@Override
public void onWeatherRetrieved(WeatherForecast forecast) {
// Data is ready
}
@Override
public void onWeatherError(WeatherLibException t) {
}
@Override
public void onConnectionError(Throwable t) {
//WeatherDialog.createErrorDialog("Error parsing data. Please try again", MainActivity.this);
}
});
}
ListdayForecastList = forecast.getForecast();
for (DayForecast dForecast : dayForecastList) {
Weather weather = dForecast.weather;
long timestamp = dForecast.timestamp;
}
weatherClient.getHourForecastWeather(new WeatherRequest(cityId), new WeatherClient.HourForecastWeatherEventListener() {
@Override
public void onWeatherRetrieved(WeatherHourForecast weatherHourForecast) {
List hourList = weatherHourForecast.getHourForecast();
for (HourForecast hourForecast: hourList) {
Weather weather = hourForecast.weather;
long timestamp = hourForecast.timestamp;
}
}
@Override
public void onWeatherError(WeatherLibException e) {
}
@Override
public void onConnectionError(Throwable throwable) {
}
});