Google places API is defiantly one of the coolest API out there. It allows you to query for registered locations and get useful information about them. The base places API supports 3 majors actions you can do:
- Add an online place picker to your Android app so the user can select a place from a live map
- Send information to google about new places or other information you receive from your users
- Display places Autocomplete as an input so users can start typing a location and select it from an auto-generated list of places
This tutorial will show how to add the Autocomplete input. The places list is repopulated with relevant places results according to the search value.
We start by adding our GEO API key to the AndroidManifest file, you can get an API key yourself from here
After you have an API key, create an Autocomplete element inside your layout view file
The activity class makes sure we’re connected to google’s API and initialize the Autocomplete element with a new Adapter