This repository contains Kotlin extensions (KTX) for:
It enables you to use Place Search API.
- API level 18+
- Places SDK through Google Play Services
In order to use the library, include the following dependency:
dependencies {
implementation 'com.urmich.android:placesearch-ktx:1.1.0'
}
The result of the API call can be converted into a set of Place objects. Such conversion accelerates the usage of Place Search and integrates the package into Place Details SDK. Do not forget to have Google Places library included.
dependencies {
implementation 'com.google.android.libraries.places:places:2.6.0'
}
Update the local.properties
file in your root directory (Note: this file should NOT be
under version control to protect your API key) and add a single line to local.properties
that
looks like PLACES_API_KEY="YOUR_API_KEY"
, where YOUR_API_KEY
is the API key you obtained in
the first step. You can also take a look at the local.defaults.properties
as an example. This is the same key you created to use Places SDK.
A demo application is contained within this repository that illustrates the use of this KTX library.
To run the demo app, you'll have to:
- Get a Places API key
- Update the
local.properties
file in your root directory and add lines tolocal.properties
that looks likePLACES_API_KEY="YOUR_API_KEY"
andMAPS_API_KEY="YOUR_MAPS_API_KEY"
.
YOUR_API_KEY
is the API key you obtained in the first step. It is the same key you use to access Places SDK.YOUR_MAPS_API_KEY
is the key to the use google map. You can also take a look at the local.defaults.properties as an example.
- Build and run
Encounter an issue while using this library?
If you find a bug or have a feature request, please file an issue. Or, if you'd like to contribute, send us a Pull Request.
For more information, check out the detailed guide on the Google Developers site.