Consumer SDK for Android Release Notes

This section contains release notes for the Consumer SDK for Android.

2.3.0 (August 2, 2024)

API changes

  • Add cloud-based maps styling support, which lets you create a customized road map experience for your users without having to update your apps' code each time you make a map style change. For more information, see Style the map with cloud-based maps styling.

  • Add getServerTimeMillis() method to VehicleLocation to determine the time when the location update was received by Fleet Engine.

2.2.0 (May 7, 2024)

API changes

  • Added support API for Jetpack Compose integration. This is an experimental feature. For details about integrating with Jetpack Compose, reach out to your representative.

2.1.0 (January 17, 2024)

Bug fixes

  • Fixes crash that occurs when the SDK is initialized more than once across the application lifecycle.

API changes

  • Introduces method to retrieve the GoogleMap instance created by the SDK (ConsumerGoogleMap.getGoogleMap()).
  • Introduces API to retrieve the Marker instances created by the SDK to represent the vehicle (ConsumerController.getConsumerMarker()).
  • Introduces API to receive client projected updates for time and distance during Journey Sharing (ProjectedRouteEta).

1.99.2 (November 3, 2023)

  • Fixes crash that occurs when the SDK is initialized from a remote process, separate from the application.

  • Fixes crash that occurs while executing a camera animation and there is not enough vertical or horizontal space for the padding. This only occurs on the latest maps renderer.

  • Fixes bug that causes the first leg of a Back-to-back trip to be trimmed out when the second leg goes through the same road.

Issues

  • The ConsumerApi.initialize() throws an exception if invoked when an API instance already exists. To work around this, first call ConsumerApi.getInstance() and evaluate the returned Task to determine if an API instance already exists.

2.0.0 (September 15, 2023)

Announcement: Breaking changes

  • Minimum API level requirement is updated from 21 to 23.

  • Updates Maps SDK version requirement from v17.0.0 to v18.1.0

  • Minimum Kotlin standard library version requirement is updated from v1.6.10 to v1.9.0

  • Update the Google Play services dependencies versions

    • Minimum play-services-base library version requirement is updated from v18.0.1 to v18.2.0

    • Minimum play-services-basement library version requirement is updated from v18.0.0 to v18.2.0

    • Minimum play-services-location library version requirement is updated from v17.0.0 to v21.0.1

    • Minimum play-services-tasks library version requirement is updated from v18.0.1 to v18.0.2

  • Adds androidx.room:room-runtime library with minimum version requirement set to v2.5.2

  • Update the following dependencies versions

    • Minimum android-maps-utils library version requirement is updated from v0.4.2 to v3.5.2

    • Minimum com.google.android.datatransport:transport-backend-cct version requirement is updated from v3.0.0 to v3.1.9

    • Minimum com.google.android.datatransport:transport-runtime version requirement is updated from v3.0.1 to v3.1.9

    • Minimum androidx.lifecycle:lifecycle-extensions version requirement is updated from v2.0.0 to v2.2.0

    • Minimum androidx.lifecycle:lifecycle-common-java8 version requirement is updated from v2.0.0 to v2.6.1

    • Minimum androidx.appcompat:appcompat version requirement is updated from v1.0.0 to v1.6.1

    • Minimum androidx.fragment:fragment version requirement is updated from v1.0.0 to v1.6.1

  • Removes the following previously deprecated APIs: ConsumerTrip, ConsumerTripCallback, ConsumerTripManager, ConsumerTripOptions. They were replaced by TripModel, TripModelCallback, TripModelManager and TripModelOptions.

  • Apps that use Consumer SDK must now have targetSdkVersion of API 31 or greater, compileSdkVersion of API 33 or greater.

  • Apps that use Consumer SDK must now enable Java 8 library support. See https://developer.android.com/studio/write/java8-support for instructions to update.

  • Apps that use Proguard or Dexguard must migrate to R8. See https://developer.android.com/build/shrink-code for more information.

  • Apps that use Consumer SDK must enable desugaring. See https://developer.android.com/studio/write/java8-support#library-desugaring for instructions.

  • The ConsumerApi.initialize() method now throws an exception if it's being invoked when there is an API instance already created. The Task returned by ConsumerApi.getInstance() must be used to determine if there's an API instance created beforehand.

Announcement: API deprecations

  • Deprecates Trip.TripStatus and Trip.TripType annotation classes, adds TripInfo.TripStatus and TripInfo.TripType annotation classes to replace them.

    • As part of to this change, TripModelCallback#onTripStatusUpdated(TripInfo tripInfo, @Trip.TripStatus int status) is deprecated and TripModelCallback#onTripStatusUpdate(TripInfo tripInfo, @TripInfo.TripStatus int status) is added to replace it.

    • As part of to this change, TripInfo#getTripStatus() is deprecated, TripInfo#getCurrentTripStatus() is added to replace it.

    • As part of to this change, TripInfo#getTripType() is deprecated, TripInfo#getCurrentTripType() is added to replace it.

  • Deprecates Trip class.

Other Changes and bug fixes

  • Supports requesting the latest Maps SDK renderer. See New Map Renderer for details.

  • Provides Maps SDK range support from v18.1.0(inclusive) to v19.0.0(exclusive) versions.

  • Fixes "deadline exceeded" error for internal communications between SDK and Google backend.

  • Fixes rendering issue for small size screen and picture-in-picture mode.

Migration guide

1.99.1 (August 31, 2023)

Bug fixes

  • Fixes crash that occurs when the SDK host activity or fragment is destroyed.

  • Fixes crash that occurs when the dimensions of the MapView are 0 (either height or width).

  • Fixes crash that occurs when projecting the vehicle location on the route polyline.

Improvements

  • Prevents the SDK from crashing when the host application is sideloaded, and the default visual resources aren't present.

1.99.0 (June 22, 2023)

Bug fixes

  • Fixes rendering issue for small-size screen and for picture-in-picture mode.

  • Fixes vehicle flickers during journey sharing.

1.2.1 (June 7, 2023)

Bug fixes

  • Fixes a bug that causes the vehicle to flicker during journey sharing.

1.2.0 (November 21, 2022)

Bug fixes

  • Fixes bug that caused empty traffic to be reported in the onTripActiveRouteTrafficUpdated callback.

New features

  • "Traffic-aware polylines" is now generally available.

1.1.2 (October 27, 2022)

Bug fixes

  • Addresses bug that cause the route polyline to disappear after a JourneySharingSession is started more than once for a TripModel.

Announcement: Freezing support for Android 5 (July 25, 2022)

For our v1.1.1 SDK version, we are providing an additional year of support for apps running on Android 5, for both API levels 21 and 22.

What this means:

  • Consumer SDK running on your Android apps will support a minimum Android 5 (API level 21) until June 30, 2023.

  • After June 30, 2023, we will support only Android API levels 23 and above. In other words, we will stop supporting Android API levels 21 and 22 across all SDK versions after that date. This means that bugs related to Android 21 or 22 in any SDK version (including 4.x) will not be fixed, and we do not guarantee that the SDKs will behave correctly.

v1.1.1 (July 25, 2022)

Dependency change

  • Downgrades the minimum supported Android API level to 21.

v1.1.0 (April 28, 2022)

  • Internal improvements.

v1.0.19 (March 17, 2022)

Bug fixes

  • Fixed a memory leak in the ConsumerApi class.

v1.0.14 (November 30, 2021)

The minimum supported Android API level is now 23.

API changes

  • Changes to the ConsumerTrip and ConsumerTripManager classes.

    • Cleaned up some method names to make their meaning clearer, and to align with the iOS platform.
  • Changes to ConsumerTripCallback, ConsumerTrip and TripInfo.

    • Changed some class names to form parity with iOS. Introduced TripModel, TirpModelManager, and TripModelOptions to deprecate ConsumerTrip, ConsumerTripManager and ConsumerTripOptions.

    • Cleaned up some method names. Revised or added JavaDoc comments to methods to convey clearer meanings.

    • Improved error handling.

Styling customization

  • Deprecated legacy wrappers

    • MarkerStyleOptions and PolylineStyleOptions were deprecated and replaced by MarkerOptions and PolylineOptions, which are both shared with the Maps SDK.

Crash monitoring

  • Added crash detection and logging.

    • An addition was made to allow you to opt out of this functionality. This was done as a part of a larger Geo-wide effort for crash monitoring.

Authentication changes

  • Remove unnecessary methods from the Authentication interfaces.
    • Removed the ServiceType parameter.

v0.9.28 (May 18, 2021)

API changes

  • Updated all ConsumerTripCallback methods to use TripInfo as the parameter.
  • Added ConsumerTrip.isRefreshing(), which indicates whether ConsumerTrip is actively updating itself with fresh trip information from Fleet Engine.
  • Added ConsumerTripCallback.onTripRemainingRouteDistanceUpdated().
  • Added ConsumerTripCallback.onTripRemainingRouteUpdated().
  • Replace Guava return types (ImmutableSet, ImmutableList) with java.util equivalent classes.
  • Package name changes:

    • com.google.android.libraries.ridesharing.common.AuthTokenContext -> com.google.android.libraries.ridesharing.consumer.auth.AuthTokenContext
    • com.google.android.libraries.ridesharing.common.AuthTokenFactory -> com.google.android.libraries.ridesharing.consumer.auth.AuthTokenFactory
    • com.google.android.libraries.ridesharing.common.FleetEngineServiceType -> com.google.android.libraries.ridesharing.consumer.auth.FleetEngineServiceType - com.google.android.libraries.ridesharing.common.model.Trip

                                  ->
                                                                  com.google.android.libraries.ridesharing.consumer.model.Trip
      
                                  -   com.google.android.libraries.ridesharing.common.model.Vehicle
      
                                                          ->
                                      com.google.android.libraries.ridesharing.consumer.model.Vehicle
      

Implementation changes

  • Fixed a race condition where the SDK could crash from interactions with the map before it is ready.
  • The SDK no longer contains an unobfuscated copy of io.grpc.
  • Fixed a bug with flickering traffic polylines on certain devices. Traffic segments will now have rounded ends.

v0.9.15 (October 7, 2020)

API changes

  • This release introduces Traffic Aware Polylines. - Added TripInfo.getActiveRouteTraffic() and TripInfo.getRemainingRouteTraffic().
    • Added ConsumerTripCallback.onTripActiveRouteTrafficUpdated() and ConsumerTripCallback.onTripRemainingRouteTrafficUpdated() to indicate when traffic has changed.
    • Added PolylineStyleOptions for traffic customization (setTrafficEnabled(), setTrafficColorNoData(), setTrafficColorNormal(), setTrafficColorSlow(), setTrafficColorTrafficJam()).
    • Exposed PolylineStyleOptions.TRAFFIC_Z_INDEX_ADDITION.
    • Added TripWaypoint.getTrafficData().
    • Added TrafficData data type.
    • Added ConsumerController.hideAllSessions(). ConsumerController.showSession() no longer accepts null as an argument.

v0.9.9 (July 15, 2020)

API changes

  • This is a major change that introduces a modularized architecture with a clearer relationship between the data-only layer (for example, ConsumerTripManager) and the user interface layer (for example, JourneySharingSession). For information on migrating to the new architecture, see the Modularization Migration Guide. - The ConsumerTrip object is now obtained from ConsumerTripManager.getTrip().
    • ConsumerTrip.unregisterCallback has been renamed to ConsumerTrip.unregisterTripCallback.
    • ConsumerTrip.isCallbackRegistered has been renamed to ConsumerTrip.isTripCallbackRegistered.
    • Added ConsumerTrip.setConsumerTripOptions() and ConsumerTrip.getConsumerTripOptions().
    • Removed ConsumerTrip.setAutoRefreshInterval().
  • Removed non-journey sharing APIs.
    • Removed vehicle density map.
    • Removed trip preview state.
    • Removed pickup selection state.
    • Removed dropoff selection state.
    • Removed the following marker types: SELECTED_PICKUP_POINT, SUGGESTED_PICKUP_POINT, HIGHLIGHTED_PICKUP_POINT, and SELECTED_DROPOFF_POINT.
  • Changed OnConsumerMarkerClickCallback and ConsumerMapReadyCallback from interfaces to abstract classes.
  • Added ConsumerController.getCameraUpdate(), ConsumerController.isAutoCameraEnabled(), and ConsumerController.enableAutoCamera().
  • Removed the custom FAB and its associated methods (ConsumerController.isMyLocationFabEnabled and ConsumerController.setMyLocationFabEnabled).

Implementation changes

  • A ConsumerTripCallback, whether registered with or without a LifecycleOwner, no longer automatically unregisters on TripStatus.COMPLETE or TripStatus.CANCELED.
  • AutoCamera is now enabled by default and never reenables or disables itself. Previously, AutoCamera automatically reenabled on TripStatus.ARRIVED_AT_PICKUP and disabled itself when the user interacted with the map during journey sharing.
  • The following improvements have been made to journey sharing vehicle animation:
    • Journey sharing animation now handles the situation where a vehicle may legitimately travel back along an already-traversed route.
    • The vehicle will now straight-line animate instead of route interpolating between points when it is determined algorithmically to be appropriate.
  • FINE_LOCATION permissions are no longer required.

Other changes

  • Updated the following dependency versions:
    • com.google.android.datatransport:transport-api:2.2.0
    • com.google.android.datatransport:transport-backend-cct:2.2.0
    • com.google.android.datatransport:transport-runtime:2.2.0

v0.9.1 (March 23, 2020)

API changes

  • Added TripInfo.getVehicleId(), TripInfo.getNumberOfPassengers(), TripInfo.getIntermediateDestinationIndex(), TripInfo.getTripActiveRoute(), and TripInfo.getTripRemainingRoute().
  • Added options class used during ConsumerApi initialization that lets the FleetEngine address to be dynamically set. If the API is not called with a FleetEngine value, it attempts to fetch it from the Android manifest or else falls back to the default value.

Improvements

  • The route polyline is not displayed when the trip status is ARRIVED_AT_PICKUP.
  • Off-route vehicle tracking has been improved (requires DriverSDK 1.15):
    • Vehicle tracking does not snap the vehicle to the route when the vehicle drives past the pickup point.
    • Vehicle tracking enables displaying the vehicle off the road; for example, in unmapped parking lots.
  • The vehicle icon now updates when the driver’s destination does not match the destination in Fleet Engine.

v0.8.6 (December 16, 2019)

API changes

  • Added TripInfo.getVehicleLocation().

  • ConsumerMapView is no longer final.

Implementation changes

  • The active leg remaining distance is now calculated using server distance (driver reported + static route where applicable) instead of local snapping. This change produces more accurate remaining distance values.

Other changes

  • New dependencies required. See the .pom file for details.

    • com.google.android.datatransport:transport-api:2.0.0
    • com.google.android.datatransport:transport-backend-cct:2.0.2
    • com.google.android.datatransport:transport-runtime:2.0.0
  • Added logs for trip request latency.

  • Added logs for trip response errors.

Notes

  • Since version 0.8.1, the Consumer SDK for Android ships as a jetified zip archive. For information about how to de-jetify it, see Jetifier: Reverse mode.

v0.8.1 (September 13, 2019)

New features

API changes

  • Added ConsumerController.disableAutoCamera() as the opposite function to centerMapForState().

  • VehicleLocation.getUpdateTime() now returns a Long that represents the timestamp (in milliseconds).

  • Simplified the AuthTokenFactory interface to expose a single method for token generation. Changed AuthTokenFactory from an interface to an abstract class to enable backwards compatibility in Java7. This change is backward compatible, but the old methods for single service token generation are deprecated, and will eventually be removed.

Implementation changes

  • Assets now centered to icon center, eliminating shadow offset.

  • setState to JOURNEY_SHARING onStartTripMonitoring() instead of waiting for monitored Trip's status.

  • Always returns data for first trip data update, even when trip data is out of sync.

  • Added Android Map Utils as a provided dependency.

Bug fixes

  • Fixed broken proguard export syntax for grpc keep.

v0.7.0 (August 7, 2019)

New features

  • Multidestination support for Journey Sharing.

API changes

  • New methods for ConsumerTripCallback.

    • onTripIntermediateDestinationsUpdated().
    • onTripETAToNextTripWaypointUpdated().
  • New ConsumerController methods.

    • getIntermediateDestinations().
    • setIntermediateDestinations(List<TerminalLocation> intermediateDestinations).
  • New TripStatuses.

    • TripStatus.ENROUTE_TO_INTERMEDIATE_DESTINATION.
    • TripStatus.ARRIVED_AT_INTERMEDIATE_DESTINATION.
  • New TripWaypoint getters.

    • getETAMillis().
    • getDistanceMeters().
  • Added the TripInfo class.

    • You can obtain TripInfo for the active trip with ConsumerTripManager.getActiveTripInfo().
  • Added WaypointType.INTERMEDIATE_DESTINATION.

  • Added MarkerType.TRIP_INTERMEDIATE_DESTINATION.

  • Created ConsumerMapState.JOURNEY_SHARING from merged ConsumerMapStates ENROUTE_TO_PICKUP, ARRIVED_AT_PICKUP, ENROUTE_TO_DROPOFF, and COMPLETE.

    • StateChangeCallbacks updated.

    • Added onStateJourneySharing().

    • Removed onStateWaitingForPickup(), onStateDriverArrived(), onStateEnroute(), and onStateEndofTrip().

Bug fixes

  • Fixed a bug where route is not trimmed to the vehicle location when trip monitoring starts in the middle of an active trip (not at head of route).

  • Fixed a bug where trip callbacks are not invoked for listeners registered on the Tripmanager after the TripManager has already fetched trip data.

  • Camera zoom now includes only the active route and the next trip waypoint (waypoint that belongs to the trip). Even if the remaining leg is visible, the zoom will never include it. Previously, the drop-off point was included in the zoom when the vehicle was either enroute to pickup, or arrived at pickup. This is no longer true.

Improvements

  • Populate the zeroth remaining waypoint with Driver data (remaining waypoint list is returned from ConsumerTripCallback.onTripRemainingWaypointsUpdated and TripInfo.getRemainingWaypoints().

  • Update all remaining waypoint ETAs when the ETA to the first waypoint in the list changes.

  • Force re-enable autocamera only when driver arrives at pickup. Previously, autocamera would reset to enabled for every trip state change. Autocamera is still enabled by default. Autocamera will not re-enable if a new active trip is set without a fresh call to startTripMonitoring().

v0.6.1 (June 26, 2019)

New features

  • Carpool support for journey sharing.

API changes

  • ConsumerController.getConsumerMapStyle() now returns ConsumerMapStyle rather than Task<ConsumerMapStyle>.

  • Added PolylineStyle.setZIndex().

Bug fixes

  • Route animation now happens only when the route segment is in sync, resulting in an improved user experience.

  • Fixed vehicle "flickering" during animation interpolation when driver location updates are close together.

  • Fixed a bug where the vehicle starts at the head of the route instead of at its most updated location when trip monitoring starts in the middle of an active trip.

  • Display the active route polyline above the remaining route when they overlap.

Improvements

  • Now expose the gRPC Status class with unobfuscated methods.

v0.5.1.01 (May 17, 2019)

New features

  • Back-to-back support for Journey Sharing.

API changes

  • New ConsumerController class.

PolylineType

Old Value New Value
TRIP_PREVIEW_AUTO_ROUTE PREVIEW_AUTO_ROUTE
TRIP_PREVIEW_TAXI_ROUTE PREVIEW_TAXI_ROUTE
TRIP_PREVIEW_TRUCK_ROUTE PREVIEW_TRUCK_ROUTE
TRIP_PREVIEW_TWO_WHEELER_ROUTE PREVIEW_TWO_WHEELER_ROUTE
TRIP_ROUTE ACTIVE_ROUTE
REMAINING_ROUTE

ConsumerTripCallback

Old Value New Value
onTripRouteUpdated onTripActiveRouteUpdated
onTripRemainingDistanceUpdated onTripActiveRouteRemainingDistanceUpdated
onTripRemainingWaypointsUpdated()

ConsumerController

  • You can now set callbacks for states without entering the state.
Method Callback
startPickupSelection setPickupSelectionCallback
startDropoffSelection setDropoffSelectionCallback
startTripPreview setTripPreviewSelectionCallback
  • ConsumerController.setLanguage(String languageCode) allows you to set the language used in FleetEngine calls (for pickup point descriptions, for example).

Improvements

  • Dropoff selection state now has a draggable pin.
  • Removed camera animation in INITIALIZE state.
  • Replaced ManagedChannelBuilder with AndroidChannelBuilder.