survivingwithandroid / WeatherLib

Android Weather Library: android weather lib to develop weather based app fast and easily
http://survivingwithandroid.github.io/WeatherLib/
640 stars 170 forks source link

OpenWeatherMap API Key required #35

Closed v1r0x closed 9 years ago

v1r0x commented 9 years ago

Since last week an API key for openweathermap is required: http://openweathermap.org/faq#error401

v1r0x commented 9 years ago

Sorry for the previous short description. The problem is, that it worked last week without any errors and since the 9th of october I got WeatherLibException in the onWeatherError showing problems in parsing the string result to json. I'm not sure, but I think I saw a ApiKeyRequiredException or something like that. I think this should be thrown if the api key is not set/null or the user should get an explanation in this case, that the api key is required. Maybe remove the default constructor and replace it with something like this:

public WeatherClient(String apiKey){
}
survivingwithandroid commented 9 years ago

The problem should be resolved in 1.5.9 just released.

swapps commented 9 years ago

hi, it still doesn't work, the api key isn't added when searching for city:

10-19 14:39:18.170: D/SwA(26713): Client [com.survivingwithandroid.weather.lib.client.volley.WeatherClientDefault@b31c86a] 10-19 14:39:18.336: E/Volley(26713): [3891] BasicNetwork.performRequest: Unexpected response code 401 for http://api.openweathermap.org/data/2.5/find?mode=json&type=like&q=Co

as you can see the apikey is missing in the url request

athkalia commented 9 years ago

Problem still exists in 1.5.9, and it's in method getQueryCityURLByLocation in line 466 of the OpenweathermapProvider. It's missing the createAPPID() method in the end. So is the getQueryCityURLByCoord method as well.

survivingwithandroid commented 9 years ago

Check 1.6.0

v1r0x commented 9 years ago

But it still throws a WeatherLibException but I think it should throw an ApiKeyRequiredException, because an API Key is required since last week.