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); } });
source share