The Navigation SDK for Android adds navigation features to the Maps SDK for Android. If your Google Maps-powered Android application needs navigation features, it must depend on the Navigation SDK for Android.
That said, most functions in the Maps SDK for Android behave the same in
the Navigation SDK for Android. You access them using the same
com.google.android.gms.maps
package, no matter which SDK dependency you use.
This means that, if your app previously depended on the
Maps SDK for Android, you can change its dependency to the
Navigation SDK for Android without affecting the existing functionality of your app, with
two notable exceptions:
- APIs that throw an exception.
- APIs that don't function in the NavSDK and have no impact when called.
These exceptions are described below.
APIs that throw an exception
The following function throws an exception if your application enables it:
APIs with no functionality in Navigation SDK
The following APIs have no functionality in the Navigation SDK, but also have no impact if your code calls them. They fall into the following categories:
- APIs for wearable activity.
- Enable TBT feed instead if you want this functionality in the Navigation SDK for Android.
- Other APIs.
APIs for wearables
GoogleMapOptions.ambientEnabled(boolean enabled) would normally allow you to disable or enable ambient mode for wearable apps. Additionally, onEnterAmbient and onExitAmbient methods exist in MapView and MapFragment, but have no impact when called. For wearables, use the TBT feed instead.
Other APIs
- Setting a custom LocationSource does nothing in the NavSDK.
- All MapsInitializer APIs.
- RuntimeRemoteException.
APIs that are only intended for use by Mobility Services customers
There are several APIs in the Navigation SDK that are only intended for use by Mobility Services customers, who are billed by Google on a per-transaction basis. If you are not a Mobility Services customer, the following methods are no-ops:
NavigationTransactionRecorder.pickup()
NavigationTransactionRecorder.dropoff()
NavigationTransactionRecorder.generatedTransactionId()
Navigator.fetchRouteInfo()
Navigator.setTransactionIds()