Awareness API always returns cloudy weather

I want to check the weather in my android app. I implemented it, but it seems that the conditions always arise: [2] and nothing more, despite the fact that it has been raining here for almost an hour.

Here is what it returns:

Temp=67.0F/19.444445C, Feels=67.0F/19.444445C, Dew=58.0F/14.444445C, Humidity=71, Condition=[2] 

I am testing this on Android v5.1, and yes, a great place in my manifest and enabled on my phone.

 <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/> 

Here is my code for getting the weather:

 Awareness.SnapshotApi.getWeather(mGoogleApiClient) .setResultCallback(new ResultCallback<WeatherResult>() { @Override public void onResult(@NonNull WeatherResult weatherResult) { if (!weatherResult.getStatus().isSuccess()) { System.out.println("error: /*- could not get weather"); return; } weather = weatherResult.getWeather(); System.out.println("weather: " + weather); } }); 
+1
source share
1 answer

Sorry your weather is terrible. Joking aside, it can be a very local downpour, while in the region it is usually cloudy, since they receive weather data from some source, there may not be rain. (Sometimes it rains in a radius of 500 m, but there is sunlight around it.

I thought it was strange at first, because during my testing the same temperature was always reported. It turned out that the temperature was really stable, and the conditions worked well for me, it caused rain, and after 15 minutes it started to rain outside my office.

+1
source

Source: https://habr.com/ru/post/1257976/


All Articles