The Consumer SDK for Android is part of Fleet Engine for on-demand trips. It provides interfaces that model trip data and follow trips in Fleet Engine, and classes to build a map-based display that shares a trip's progress (vehicle location, route, ETA, remaining distance, traffic) with consumers in an Android app.

## Consumer SDK for Android: key facts

- **Product:** Consumer SDK for Android
- **Also known as:** Android Consumer SDK, Consumer SDK, Mobility Services On-demand Trips Android Consumer SDK
- **Category:** Routes
- **Platform:** Android
- **Runs on:** Client (app or browser code)
- **Launch stage:** GA
- **Lifecycle:** Active
- **Overview:** [Consumer SDK for Android overview](https://developers.google.com/maps/documentation/mobility/journey-sharing/on-demand.md.txt)

## Consumer SDK for Android: when to use it

**Use Consumer SDK for Android when:**

- You need consumers in your Android app to follow an on-demand trip (ride, order, or delivery) that your backend tracks in Fleet Engine.
- You need to show a vehicle's near real-time, road-snapped location and route on a map in an Android consumer app.
- You need to show pickup and drop-off ETA, remaining distance, and live traffic for a Fleet Engine trip in Android.
- You need to customize trip markers, route polylines, or map styling for a journey-sharing map in Android.
**Don't use Consumer SDK for Android when:**

- You need journey sharing for on-demand trips in an iOS app. Use [Consumer SDK for iOS](https://developers.google.com/maps/documentation/mobility/journey-sharing/quick-reference-ios.md.txt) instead.
- You need journey sharing in a web page, or consumer tracking of scheduled tasks such as shipments. Use [JavaScript Consumer SDK](https://developers.google.com/maps/documentation/mobility/journey-sharing/quick-reference-js.md.txt) instead.
- You need to report driver location and trip progress from the driver's Android app. Use [Driver SDK for Android](https://developers.google.com/maps/documentation/mobility/driver-sdk/quick-reference-android.md.txt) instead.

## Consumer SDK for Android: setup

- **Authentication:** JSON Web Token (JWT), API key
- **Also enable:** [Fleet Engine Service](https://developers.google.com/maps/documentation/mobility/fleet-engine/quick-reference.md.txt), [Maps SDK for Android](https://developers.google.com/maps/documentation/android-sdk/quick-reference.md.txt)
- **Get started:** [Set up Consumer SDK for Android](https://developers.google.com/maps/documentation/mobility/journey-sharing/on-demand/android/setup.md.txt)
- **Reference:** [Consumer SDK for Android reference](https://developers.google.com/maps/documentation/mobility/journey-sharing/on-demand/reference/consumer_4/android/reference/packages.md.txt)
- **Policies:** [Consumer SDK for Android policies](https://developers.google.com/maps/documentation/mobility/services/terms.md.txt)
- **Release notes:** [Consumer SDK for Android release notes](https://developers.google.com/maps/documentation/mobility/services/resources/relnotes_consumer_sdk_android.md.txt)

**Official Consumer SDK for Android packages:**

- maven: `com.google.android.libraries.mapsplatform.transportation:transportation-consumer`

## Consumer SDK for Android: related products

- **Often used with:** [Fleet Engine Service](https://developers.google.com/maps/documentation/mobility/fleet-engine/quick-reference.md.txt), [Driver SDK for Android](https://developers.google.com/maps/documentation/mobility/driver-sdk/quick-reference-android.md.txt), [Maps SDK for Android](https://developers.google.com/maps/documentation/android-sdk/quick-reference.md.txt)

## Consumer SDK for Android: common mistakes

- **Problem:** If the Maps SDK dependency isn't set to an explicit version, the Consumer SDK uses the minimum required Maps SDK version, which can break apps that rely on features in later Maps SDK versions. **Fix:** Declare an explicitly defined `play-services-maps` version alongside `transportation-consumer` in Gradle or Maven. See [/maps/documentation/mobility/journey-sharing/on-demand/android/configure-project](https://developers.google.com/maps/documentation/mobility/journey-sharing/on-demand/android/configure-project.md.txt).
- **Problem:** Not stopping journey sharing after a trip ends causes unnecessary network requests to Fleet Engine and memory leaks. **Fix:** Call `JourneySharingSession.stop()` when the trip is no longer needed, for example in `onDestroy()` or when the trip is `COMPLETE`. See [/maps/documentation/mobility/journey-sharing/on-demand/android/share-journey](https://developers.google.com/maps/documentation/mobility/journey-sharing/on-demand/android/share-journey.md.txt).
- **Problem:** `ConsumerApi.initialize()` throws an exception if an API instance already exists (2.0.0 and later). **Fix:** Call `ConsumerApi.getInstance()` first and check the returned `Task` to determine whether an instance already exists. See [/maps/documentation/mobility/services/resources/relnotes_consumer_sdk_android](https://developers.google.com/maps/documentation/mobility/services/resources/relnotes_consumer_sdk_android.md.txt).
- **Problem:** Consumer SDK v3 and below doesn't support Full R8 mode; apps targeting AGP 8.0+ can hit build or runtime issues. **Fix:** Set `android.enableR8.fullMode=false` when targeting AGP 8.0+, and use AGP 7.3+ with Kotlin 2.0 for Consumer SDK 3.0+. See [/maps/documentation/mobility/journey-sharing/on-demand/android/migration-guide-v3](https://developers.google.com/maps/documentation/mobility/journey-sharing/on-demand/android/migration-guide-v3.md.txt).

## Consumer SDK for Android: legacy and deprecated features

- **`ConsumerTrip`, `ConsumerTripCallback`, `ConsumerTripManager`, `ConsumerTripOptions`:** Decommissioned since 2023-09-15. **Replacement:** `TripModel`, `TripModelCallback`, `TripModelManager`, `TripModelOptions`. See the [migration guide](https://developers.google.com/maps/documentation/mobility/services/resources/relnotes_consumer_sdk_android.md.txt#200_september_15_2023).
- **`Trip` class and `Trip.TripStatus` / `Trip.TripType` annotations (and `TripInfo#getTripStatus()`, `TripInfo#getTripType()`, `TripModelCallback#onTripStatusUpdated`):** Deprecated since 2023-09-15. **Replacement:** `TripInfo.TripStatus` / `TripInfo.TripType`, `TripInfo#getCurrentTripStatus()`, `TripInfo#getCurrentTripType()`, `TripModelCallback#onTripStatusUpdate`. See the [migration guide](https://developers.google.com/maps/documentation/mobility/services/resources/relnotes_consumer_sdk_android.md.txt#200_september_15_2023).
- **`MarkerStyleOptions` and `PolylineStyleOptions`:** Decommissioned since 2021-11-30. **Replacement:** `MarkerOptions` and `PolylineOptions` (shared with the Maps SDK). **Symptom:** Consumer SDK applies its own default style per marker or polyline type, not `MarkerOptions` defaults. See the [migration guide](https://developers.google.com/maps/documentation/mobility/journey-sharing/on-demand/android/migration-guide-v1.md.txt).
- **Private repository distribution channel:** Deprecated. **Replacement:** Google Maven repository (versions 2.1.0 and later). See the [migration guide](https://developers.google.com/maps/documentation/mobility/journey-sharing/on-demand/android/setup.md.txt#maven).

## What you can do with Consumer SDK for Android

See the guides linked below for each task, or compare across products in the
[Capabilities Explorer](https://developers.google.com/maps/documentation/capabilities-explorer.md.txt).

- [Add a customizable, interactive map that tracks the progress of a trip from Fleet Engine to a mobile app.](https://developers.google.com/maps/documentation/mobility/journey-sharing/on-demand/android/create-ui.md.txt)
- [Add a route polyline that tracks a trip from Fleet Engine to a map on a web page or mobile app.](https://developers.google.com/maps/documentation/mobility/journey-sharing/on-demand/android/customize-polylines.md.txt#active-route)
- [Update trip progress along a route in a map on a web page or mobile app for a Fleet Engine trip.](https://developers.google.com/maps/documentation/mobility/journey-sharing/on-demand/android/share-journey.md.txt#update)
- [Change the style of roads, polylines, and polygons on a map that tracks the progress of a trip from Fleet Engine.](https://developers.google.com/maps/documentation/mobility/journey-sharing/on-demand/android/style.md.txt#cbms)
- [Display or hide map features on a map that tracks the progress of a trip from Fleet Engine.](https://developers.google.com/maps/documentation/mobility/journey-sharing/on-demand/android/style.md.txt#cbms)
- [Change the style of icons and text labels on a map that tracks the progress of a trip from Fleet Engine.](https://developers.google.com/maps/documentation/mobility/journey-sharing/on-demand/android/style.md.txt#cbms)
- [Apply different map styles to different zoom levels on a map that tracks the progress of a trip from Fleet Engine.](https://developers.google.com/maps/documentation/mobility/journey-sharing/on-demand/android/style.md.txt#cbms)
- [Change the density of places on a map that tracks the progress of a trip from Fleet Engine.](https://developers.google.com/maps/documentation/mobility/journey-sharing/on-demand/android/style.md.txt#cbms) Experimental **Note:** Cloud-based Maps Styling support in the Consumer SDK is GA, while POI density control is an Experimental Cloud-based Maps Styling feature (supported on light map styles only).
- [Change the style of buildings on a map that tracks the progress of a trip from Fleet Engine.](https://developers.google.com/maps/documentation/mobility/journey-sharing/on-demand/android/style.md.txt#cbms) Experimental **Note:** Cloud-based Maps Styling support in the Consumer SDK is GA, while 3D and footprint building style customization is an Experimental Cloud-based Maps Styling feature (supported on light map styles only).
- [Change the style of landmarks on a map that tracks the progress of a trip from Fleet Engine.](https://developers.google.com/maps/documentation/mobility/journey-sharing/on-demand/android/style.md.txt#cbms) Experimental **Note:** Cloud-based Maps Styling support in the Consumer SDK is GA, while landmark icon customization is an Experimental Cloud-based Maps Styling feature (supported on light map styles only).
- [Customize a marker on a map that tracks the progress of a trip from Fleet Engine.](https://developers.google.com/maps/documentation/mobility/journey-sharing/on-demand/android/customize-markers.md.txt)
- [Customize the route polyline on a map that tracks the progress of a trip from Fleet Engine.](https://developers.google.com/maps/documentation/mobility/journey-sharing/on-demand/android/customize-polylines.md.txt)