Places SDK for Android quick reference

Places SDK for Android lets Android apps access Google's database of place and business information through Place Autocomplete, Place Details, Nearby Search, Text Search, and Place Photos. Places SDK for Android (New) is the current version and depends on Places API (New).

Places SDK for Android: key facts

  • Product: Places SDK for Android
  • Also known as: Places SDK for Android (New)
  • Category: Places
  • Platform: Android
  • Runs on: Client (app or browser code)
  • Launch stage: GA
  • Lifecycle: Active
  • Overview: Places SDK for Android overview

Places SDK for Android: when to use it

Use Places SDK for Android when:

  • You need place details, photos, Nearby Search, or Text Search results inside a native Android app.
  • You need a ready-made autocomplete widget or Places UI Kit components that return place predictions as users type in an Android app.
  • You need prebuilt Places UI Kit fragments or Jetpack Compose composables (AdvancedPlaceDetails, AdvancedPlaceDetailsCompact) to display place details.
  • You need to build location-aware Android features based on businesses and points of interest near the user's device.

Don't use Places SDK for Android when:

Places SDK for Android: setup

Official Places SDK for Android packages:

  • maven: com.google.android.libraries.places:places

Places SDK for Android: common mistakes

  • Problem: Nearby Search requests without a field list (field mask), or with an empty one, return an error. Fix: Pass at least one Place.Field in the SearchNearbyRequest field list. See /maps/documentation/places/android-sdk/nearby-search.
  • Problem: Place Details (New), Nearby Search (New), and Autocomplete (New) fail when the API key lacks Places API (New), or on SDK 5.x and earlier when the app calls Places.initialize(). Version 6.0.2 removed Places.initialize(), so code calling it doesn't compile after upgrading. Fix: Enable Places API (New), add it to the API key's allowed APIs, and initialize with Places.initializeWithNewPlacesApiEnabled(). See /maps/documentation/places/android-sdk/legacy/migrate-overview.
  • Problem: The Place returned by fetchPlace() has no PhotoMetadata (so there's nothing to resolve) when the field list omits PHOTO_METADATAS. Fix: Include Place.Field.PHOTO_METADATAS in the field list. Because fetchResolvedPhotoUri() is deprecated, use the Places UI Kit Place Details component to display photos. See /maps/documentation/places/android-sdk/place-photos.
  • Problem: Apps that show place details, photos, or reviews without the returned third-party and author attributions violate the policies. Fix: Display the attributions returned with Place, PhotoMetadata, and Review objects. See /maps/documentation/places/android-sdk/policies.
  • Problem: Nested ProvidePlacesAnalyticsHandler blocks override outer handlers for components inside the inner block, and non-Compose Places UI Kit views do not emit events to ProvidePlacesAnalyticsHandler or support card-level onClick. Fix: Use ProvidePlacesAnalyticsHandler and card-level onClick with the AdvancedPlaceDetails and AdvancedPlaceDetailsCompact composables, and keep in mind that inner handlers override outer ones. See /maps/documentation/places/android-sdk/places-ui-kit-analytics.
  • Problem: Custom content slots (basicSectionTop and basicSectionBottom in the slots lambda) are not supported in the full AdvancedPlaceDetails composable or Fragment views, and hiding the place name isn't supported in Fragment views (AdvancedPlaceDetailsFragment, AdvancedPlaceDetailsCompactFragment). Fix: Use the AdvancedPlaceDetailsCompact composable for custom content slots, and use the AdvancedPlaceDetails or AdvancedPlaceDetailsCompact composable (omitting NAME from content) to hide the place name. See /maps/documentation/places/android-sdk/advanced-place-details-ui-kit.
  • Problem: Places UI Kit requests with an invalid, expired (>10 minutes), or cross-project contentTokens set, or an AdvancedPlaceListFragment with any uncovered place, load normally and bill at standard rates without returning an error, and the SDK doesn't persist tokens across requests or accept them on PlaceReference.Coordinates. Fix: On Places SDK for Android 6.1.0+, pass contentTokens (up to 100 tokens, 2,048 UTF-8 bytes each) from the same Cloud project on each PlaceReference.PlaceId/PlaceReference.ResourceName, loadWithPlaceId/loadWithResourceName, or configureFromPlaceIds/configureFromResourceNames call within 10 minutes. See /maps/ai/agentic-data-visualization-token.

Places SDK for Android: legacy and deprecated features

  • Places SDK for Android (Legacy) / Places API (Legacy) features (Autocomplete, Current Place, Place Details, Place Photos legacy): Legacy since 2025-03-01. Replacement: Places SDK for Android (New) features backed by Places API (New), initialized with Places.initializeWithNewPlacesApiEnabled(). Symptom: As of October 2026, new Cloud projects can't enable Places API (Legacy) (existing projects remain supported). SDK 6.0.2 removed the legacy methods, which exist only in 5.x and earlier. See the migration guide.
  • Places.initialize(): Decommissioned since 2026-09-30. Replacement: Places.initializeWithNewPlacesApiEnabled(). Symptom: Method removed from the SDK in 6.0.2; code that calls it no longer compiles. See the migration guide.
  • PlacesClient.findCurrentPlace() and awaitFindCurrentPlace() (Current Place, legacy): Decommissioned since 2026-09-30. Replacement: PlacesClient.searchNearby() (Nearby Search (New)). Symptom: Methods and FindCurrentPlaceRequest/FindCurrentPlaceResponse classes removed in 6.0.2. See the migration guide.
  • PlacesClient.fetchPhoto() and awaitFetchPhoto(): Decommissioned since 2026-09-30. Replacement: Places UI Kit Place Details component (PlacesClient.fetchResolvedPhotoUri() is deprecated). Symptom: Methods and FetchPhotoRequest/FetchPhotoResponse classes removed in 6.0.2. See the migration guide.
  • Places API (Legacy) autocomplete widget (Autocomplete, AutocompleteSupportFragment, AutocompleteActivityMode): Decommissioned since 2026-09-30. Replacement: Place Autocomplete (New) widget (PlaceAutocomplete) or PlacesClient.findAutocompletePredictions(). Symptom: Classes removed from the SDK in 6.0.2. See the migration guide.
  • Places compatibility library (com.google.android.libraries.places:places-compat): Deprecated since 2022-03-31. Replacement: Places SDK for Android (com.google.android.libraries.places:places). Symptom: Frozen at v2.6.0; no new features or bug fixes.
  • AutocompleteFragment class: Decommissioned since 2025-09-25. Replacement: Place Autocomplete (New) widget (PlaceAutocomplete). Symptom: Class removed from the SDK in 5.0.0 (AutocompleteSupportFragment was also removed in 6.0.2).

What you can do with Places SDK for Android

See the guides linked below for each task, or compare across products in the Capabilities Explorer.

Places SDK for Android: Generative AI

Places SDK for Android: Places

Places SDK for Android: Places UI Kit

  • Apply CSS styling to a place data UI element. Note: CSS custom properties apply to Maps JavaScript API Places UI Kit elements; Places SDK for Android and Places SDK for iOS style Place UI Kit views programmatically using theme and style attributes. EEA COMPLIANCE REQUIREMENT: For showing place data on a map in the European Economic Area (EEA), do not call Places API web services from a backend server. Use client-side Places UI Kit components on the target platform (Maps JavaScript API on web, Places SDK for Android on Android, or Places SDK for iOS on iOS). See the EEA requirements and FAQ.
  • Customize place data UI element styling and configurations with a UI element customization tool. Note: EEA COMPLIANCE REQUIREMENT: For showing place data on a map in the European Economic Area (EEA), do not call Places API web services from a backend server. Use client-side Places UI Kit components on the target platform (Maps JavaScript API on web, Places SDK for Android on Android, or Places SDK for iOS on iOS). See the EEA requirements and FAQ.
  • Add a UI element that displays information about a specific place to a web page or mobile app. Note: On web (Maps JavaScript API), use gmp-place-details, gmp-place-details-compact, gmp-advanced-place-details, or gmp-advanced-place-details-compact. On Android (Places SDK for Android), use PlaceDetailsFragment, PlaceDetailsCompactFragment, AdvancedPlaceDetailsFragment, or AdvancedPlaceDetailsCompactFragment for Views, or the AdvancedPlaceDetails and AdvancedPlaceDetailsCompact Jetpack Compose @Composable functions. On iOS (Places SDK for iOS), use PlaceDetailsView, PlaceDetailsCompactView, AdvancedPlaceDetailsView, or AdvancedPlaceDetailsCompactView. EEA COMPLIANCE REQUIREMENT: For showing place data on a map in the European Economic Area (EEA), do not call Places API web services from a backend server. Use client-side Places UI Kit components on the target platform (Maps JavaScript API on web, Places SDK for Android on Android, or Places SDK for iOS on iOS). See the EEA requirements and FAQ.
  • Add a customizable place details UI element with configurable action buttons and filtered reviews and media to a web page or mobile app. Note: Bills the Places UI Kit Pro SKU. On web (Maps JavaScript API), use gmp-advanced-place-details (AdvancedPlaceDetailsElement) or gmp-advanced-place-details-compact (AdvancedPlaceDetailsCompactElement). On Android (Places SDK for Android), use the Jetpack Compose @Composable functions AdvancedPlaceDetails (vertical full layout, supporting SearchReviewsOptions and SearchMediaOptions) and AdvancedPlaceDetailsCompact (vertical or horizontal compact layout, supporting SearchMediaOptions and custom content slots via the slots lambda (basicSectionTop and basicSectionBottom)), or the Fragment views AdvancedPlaceDetailsFragment and AdvancedPlaceDetailsCompactFragment; hiding the place name (omitting NAME from content) is supported on the composables. On iOS (Places SDK for iOS), use AdvancedPlaceDetailsView or AdvancedPlaceDetailsCompactView (custom content slots via placeDetailsCompactContentSlot are supported on AdvancedPlaceDetailsCompactView). EEA COMPLIANCE REQUIREMENT: For showing place data on a map in the European Economic Area (EEA), do not call Places API web services from a backend server. Use client-side Places UI Kit components on the target platform (Maps JavaScript API on web, Places SDK for Android on Android, or Places SDK for iOS on iOS). See the EEA requirements and FAQ.
  • Add a UI element that displays a list of places based on a query string to a web page. Note: Supported on both web pages (Maps JavaScript API) and mobile apps (Places SDK for Android and Places SDK for iOS). EEA COMPLIANCE REQUIREMENT: For showing place data on a map in the European Economic Area (EEA), do not call Places API web services from a backend server. Use client-side Places UI Kit components on the target platform (Maps JavaScript API on web, Places SDK for Android on Android, or Places SDK for iOS on iOS). See the EEA requirements and FAQ.
  • Add a UI element that displays a list of places near a specific location to a web page. Note: Supported on both web pages (Maps JavaScript API) and mobile apps (Places SDK for Android and Places SDK for iOS). EEA COMPLIANCE REQUIREMENT: For showing place data on a map in the European Economic Area (EEA), do not call Places API web services from a backend server. Use client-side Places UI Kit components on the target platform (Maps JavaScript API on web, Places SDK for Android on Android, or Places SDK for iOS on iOS). See the EEA requirements and FAQ.
  • Add a basic autocomplete UI element to a web page or app that returns Google Place identifiers based on a query string. Note: EEA COMPLIANCE REQUIREMENT: For showing place data on a map in the European Economic Area (EEA), do not call Places API web services from a backend server. Use client-side Places UI Kit components on the target platform (Maps JavaScript API on web, Places SDK for Android on Android, or Places SDK for iOS on iOS). See the EEA requirements and FAQ.
  • Subscribe to analytics events from user interactions with place data UI elements. Note: Analytics events are intended for telemetry and analytics rather than critical UI navigation, because callback timing is not guaranteed to be synchronous and events or tags may change over time. On web (Maps JavaScript API), add a gmp-analytics event listener to Settings.getInstance(). On Android (Places SDK for Android), wrap Places UI Kit composables (AdvancedPlaceDetails or AdvancedPlaceDetailsCompact) in ProvidePlacesAnalyticsHandler. On iOS (Places SDK for iOS), attach the onPlaceAnalyticsEvent modifier to a Places UI Kit view or parent container.
  • Respond to user taps on a place data UI element. Note: Supported on Android and iOS only (not supported on web). Card tap callbacks pass a Place containing the place ID, coordinates, and viewport bounds for UI actions such as centering a map or opening full place details. On Android, pass the onClick parameter to Places UI Kit composables (AdvancedPlaceDetails or AdvancedPlaceDetailsCompact). On iOS, attach the onTap modifier directly to the Places UI Kit view before generic SwiftUI View modifiers.
  • Display place data UI elements with a grounding content token from an AI agent response. Note: Only search_places and search_along_route from Maps Experience agent tools (mapstools.googleapis.com) issue contentToken (not Grounding with Google Maps). Tokens waive Places UI Kit charges for 10 minutes on supported components under the same Cloud project; invalid or expired tokens bill at standard rates without an error.