Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Autocomplete Google Places sample

I'm trying to run the Google Place Code Sample, but I am not able to do it.

I am receiving error messages like:

Error getting autocomplete prediction API call: Status{statusCode=TIMEOUT, resolution=null}

I added my Google Map V2 ApiKey to the Manifest, and signed the app with the right certificate, so it seems that the key could be here:

    mGoogleApiClient = new GoogleApiClient.Builder(this)
            .enableAutoManage(this, 0 /* clientId */, this)
            .addConnectionCallbacks(this)
            .addApi(Places.GEO_DATA_API)
            .build(); 

I am not sure what is supposed to be in the clientId slot, and there is not too much info out there. Just other people with the same problem but without solution.

By the way if somebody wants to take a look to the complete code it is here: https://github.com/googlesamples/android-play-places/issues/3

like image 656
lm2a Avatar asked Jun 14 '26 18:06

lm2a


1 Answers

This error can be caused by not enabling the Places API for Android in your Google Developer Console (This is different from the regular Places API).

It can also be caused if you set your API key using the old 'maps' identifier instead of com.google.android.geo.API_KEY, when adding the google meta-data to your application manifest.

like image 144
blameitonsean Avatar answered Jun 16 '26 08:06

blameitonsean



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!