2
votes

Using Google Places API for Android, I'd like to know how to create an AutocompleteFilter of type address. Specifically I don't know what value(s) to use for the placeTypes parameter in the AutocompleteFilter.create method (see https://developer.android.com/reference/com/google/android/gms/location/places/AutocompleteFilter.html).

According to documentation (https://developers.google.com/places/supported_types#table3), the supported types are:

  • geocode instructs the Place Autocomplete service to return only geocoding results, rather than business results. Generally, you use this request to disambiguate results where the location specified may be indeterminate.
  • address instructs the Place Autocomplete service to return only geocoding results with a precise address. Generally, you use this request when you know the user will be looking for a fully specified address.
  • establishment instructs the Place Autocomplete service to return only business results.
  • ...

For geocode and establishment, the type values are defined in the Place class, namely Place.TYPE_GEOCODE and Place.TYPE_ESTABLISHMENT. But there is no Place.TYPE_ADDRESS.

2
developers.google.com/places/webservice/… it looks like geocode might be the string to use? - stkent
I'm using android API. And AutocompleteFilter.create takes Integer. - PH88
Also according to documentation, geocode, address, establishment are different types. What I need are those address type places only. - PH88

2 Answers

1
votes

I (and many others) have also noticed this. Unfortunately, it looks like address is not supported. See here:

https://github.com/googlesamples/android-play-places/issues/6#issuecomment-114951775

0
votes

It would be something like this

https://maps.googleapis.com/maps/api/place/autocomplete/json?input=Vict&types=address&key=API_KEY