Skip to content

Instantly share code, notes, and snippets.

@Ikhiloya
Created June 1, 2019 22:44
Show Gist options
  • Select an option

  • Save Ikhiloya/26bd1856c7001585960d13b97d2a7cd2 to your computer and use it in GitHub Desktop.

Select an option

Save Ikhiloya/26bd1856c7001585960d13b97d2a7cd2 to your computer and use it in GitHub Desktop.
Google Places Initialization in android
String apiKey = getString(R.string.api_key);
/**
* Initialize Places. For simplicity, the API key is hard-coded. In a production
* environment we recommend using a secure mechanism to manage API keys.
*/
if (!Places.isInitialized()) {
Places.initialize(getApplicationContext(), apiKey);
}
// Create a new Places client instance.
PlacesClient placesClient = Places.createClient(this);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment