How to get weather info with Google Awareness API?
<p>I have an activity with one button that I want to use to give me some weather info inside the same activity (that I display with some textView under the button...). I have something like this:</p>

<pre><code> ______________________
| give me weather info |  (button with onClick="addMeteoInfo")
 """"""""""""""""""""""
temperature:                (TextView)
humidity:                     (TextView)
</code></pre>

<p>I'm trying to use the Google Awareness Api to get the weather info about my current location (<a href="https://developers.google.com/awareness/android-api/get-started" rel="nofollow noreferrer">https://developers.google.com/awareness/android-api/get-started</a>), but I have some troubles...
the steps that I have followed are:</p>

<p>1) Add in my manifest file:</p>

<pre><code>&lt;uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" /&gt;

&lt;meta-data android:name="com.google.android.awareness.API_KEY" android:value="@string/google_maps_key" /&gt; 

&lt;meta-data android:name="com.google.android.geo.API_KEY" android:value="@string/google_maps_key" /&gt;
</code></pre>

<p>where "@string/google_maps_key" is the string that I have obtained through the the Google Developers Console and then added to my strings.xml file resource.</p>

<p>2) Add in my build.gradle (Module: app) file:</p>

<p><code>compile 'com.google.android.gms:play-services-awareness:9.6.1'</code></p>

<p>3) in my activity I have:</p>

<pre><code>@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_nuova_battuta);
    ...
    android.content.Context context;
    GoogleApiClient client = new GoogleApiClient.Builder(context)
        .addApi(Awareness.API)
        .build();
    client.connect(); 
}

// onClick method for button "give me weather info"
public void addMeteoInfo(View view){
    richiediInfoMeteo();
}

public void richiediInfoMeteo() {
    if( !checkLocationPermission() ) {
        return;
    }

    Awareness.SnapshotApi.getWeather(mGoogleApiClient)
            .setResultCallback(new ResultCallback&lt;WeatherResult&gt;() {
                @Override
                public void onResult(@NonNull WeatherResult weatherResult) {

                    if (!weatherResult.getStatus().isSuccess()) {      &lt;----HERE
                        Log.e(TAG, "Could not get weather.");

                        return;
                    }

                    Weather weather = weatherResult.getWeather();
                    Log.e("Tuts+", "Temp: " + weather.getTemperature(Weather.FAHRENHEIT));
                    Log.e("Tuts+", "Feels like: " + weather.getFeelsLikeTemperature(Weather.FAHRENHEIT));
                    Log.e("Tuts+", "Dew point: " + weather.getDewPoint(Weather.FAHRENHEIT));
                    Log.e("Tuts+", "Humidity: " + weather.getHumidity() );

                    //converto i valori interi ottenuti dall'API Google play services, in stringhe
                    String temperaturaStr = Double.toString(weather.getTemperature(Weather.CELSIUS));
                    String temperaturaPercepitaStr = Double.toString(weather.getFeelsLikeTemperature(Weather.CELSIUS));
                    String puntoRugiadaStr = Double.toString(weather.getDewPoint(Weather.CELSIUS));
                    String umiditaStr = Double.toString(weather.getHumidity());

                    //prelevo id visualizzatori di tali valori nel layout
                    mostraTemperatura = (TextView) findViewById(R.id.temperatura);
                    mostraTemperaturaPercepita = (TextView) findViewById(R.id.temperaturaPercepita);
                    mostraPuntoRugiada = (TextView) findViewById(R.id.puntoDiRugiada);
                    mostraUmidita = (TextView) findViewById(R.id.umidita);

                    // setto i visualizzatori ai valori convertiti in stringhe
                    mostraTemperatura.setText(temperaturaStr);
                    mostraTemperaturaPercepita.setText(temperaturaPercepitaStr);
                    mostraPuntoRugiada.setText(puntoRugiadaStr);
                    mostraUmidita.setText(umiditaStr);

                }
            });
}


private boolean checkLocationPermission() {
    //se permessi non disponibili allora li richiedo tramite finestra dialog
    if( !hasLocationPermission() ) {
        Log.e("Tuts+", "Does not have location permission granted");
        requestLocationPermission();
        return false;
    }
    //altrimenti se possiede già permessi
    return true;
}

private boolean hasLocationPermission() {
    return ContextCompat.checkSelfPermission( this, Manifest.permission.ACCESS_FINE_LOCATION )
            == PackageManager.PERMISSION_GRANTED;
}

private void requestLocationPermission() {
    ActivityCompat.requestPermissions(
            NuovaBattutaActivity.this,
            new String[]{ Manifest.permission.ACCESS_FINE_LOCATION },
            RICHIESTA_PERMESSO_INFO_METEO );
}

@Override
public void onRequestPermissionsResult(int requestCode, @NonNull String[] permissions, @NonNull int[] grantResults) {
    switch (requestCode) {
        case RICHIESTA_PERMESSO_INFO_METEO:
            // If request is cancelled, the result arrays are empty.
            if (grantResults.length&gt;0 &amp;&amp; grantResults[0] == PackageManager.PERMISSION_GRANTED) {
                //granted
                richiediInfoMeteo();
            } else {
                Log.e("Tuts+", "Location permission denied.");
            }
        default:
            break;
    }
}
</code></pre>

<p>So when I run my app in the AVD I always abtain in console the message:
Could not get weather. ie the method weatherResult.getStatus().isSuccess() (in richiediInfoMeteo() method) always returns false. 
Where am I wrong? How can I handle this?</p>

<p>Thanks in advance.</p>