Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Creating a place type filter for the Place Autocomplete API for Android

This API seems to be fairly new so there aren't many questions about it here, nor many tutorials.

I followed Google's tutorial and got the Autocomplete Android api working in my app. I'm now trying to use the AutocompleteFilter to restrict my results to a certain region or certain types of places.

There seems to be little to no documentation for a beginner like me explaining what to do.

The AutocompleteFilter requires a Collection object. How do I change the the following values into integers?

https://developers.google.com/places/supported_types#table3

like image 838
Asim Avatar asked Nov 30 '22 10:11

Asim


1 Answers

Problem was solved by a Google employee himself whom I contacted via our Maps for Work support portal.

Here's a list of Place Types with their integer counterparts.

https://developers.google.com/android/reference/com/google/android/gms/location/places/Place

These can be used to filter the Android Place Autocomplete API.

like image 102
Asim Avatar answered May 13 '23 03:05

Asim