WeatherLib
WeatherLib copied to clipboard
I can't get searchCity list
Not sure if I set it right, but I understand from the documentation (http://survivingwithandroid.github.io/WeatherLib/android_weatherlib_search_city.html) that I'm supposed to set as pattern the city name's string. It doesn't work for me though. The method onCityListRetrieved doesn't seem to be called when I pass the name of a city, and the cityList (where I'm supposed to get the IDs) is not even created. Can anyone link me an example?
Update: onWeatherError in searchCity returns "JSONException: no value for list". How do I fix it?
i will check,,,
I have the same exact problem using both Yahoo provider and OpenWeatherMap provider. The list is returned with empty. Is there any specific regex that we should pass?
I am also facing the same issue, any solutions ?
No, at the moment the only way for me is to use the open weather provider, the others do not work, I think the APIs are not up to date with the project.
Which provider are you using now ? I cant see open weather provider.
@surinsukumar I use this one and it works but you need to register and create your own key
if(config == null){ config = new WeatherConfig(); config.maxResult = 10; config.numDays = 1; config.ApiKey = "your key goes here"; config.unitSystem = WeatherConfig.UNIT_SYSTEM.M; }
WeatherClient client = builder.attach(context) .provider(new OpenweathermapProviderType()) .httpClient(com.survivingwithandroid.weather.lib.client.okhttp.WeatherDefaultClient.class) .config(config) .build();
Thank you raffaeu, Openweather map is working isnt it ?
Thank you @raffaeu it is working perfect for me.