Reputation: 1806
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
.
Upvotes: 2
Views: 928
Reputation: 26
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
Upvotes: 1
Reputation: 8429
It would be something like this
https://maps.googleapis.com/maps/api/place/autocomplete/json?input=Vict&types=address&key=API_KEY
Upvotes: 0