NunavSdk

object NunavSdk

The main class to interact with the Nunav Navigation SDK. This class is used for configuring the SDK and starting navigation sessions.

Properties

Link copied to clipboard

Indicates if the initialize method got called successfully.

Functions

Link copied to clipboard
fun addNavigationStoppedListener(listener: () -> Unit)
Link copied to clipboard

Add a listener notified when an intermediate (non-final) stop of a multi-stop navigation is reached. Reaching the final destination triggers OnNavigationFinishedListener instead.

Link copied to clipboard
fun initialize(context: Context, apiKey: String, serviceUrl: String = ServiceUrls.NAVIGATION)

Initialize the SDK. Needs to be called once before starting the first navigation, but not again for the next navigation.

Link copied to clipboard
fun setDestinations(destinations: List<DestinationConfiguration>, routingConfiguration: RoutingConfiguration = RoutingConfiguration()): SetDestinationsError?

Replace the whole set of destinations of the currently running navigation. Keeps the given order and routes to one stop at a time. If the first entry matches the current stop, the active leg is not interrupted.

Link copied to clipboard
@RequiresPermission(allOf = ["android.permission.ACCESS_FINE_LOCATION", "android.permission.ACCESS_COARSE_LOCATION", "android.permission.POST_NOTIFICATIONS"])
fun startNavigation(context: Context, latitude: Double, longitude: Double)

Start a basic navigation without any additional meta data.

@RequiresPermission(allOf = ["android.permission.ACCESS_FINE_LOCATION", "android.permission.ACCESS_COARSE_LOCATION", "android.permission.POST_NOTIFICATIONS"])
fun startNavigation(context: Context, destinations: List<DestinationConfiguration>, routingConfiguration: RoutingConfiguration = RoutingConfiguration()): SetDestinationsError?

Start a multi-stop navigation. The navigation visits the destinations in the given order, routing to one stop at a time. The routingConfiguration applies to the whole trip; per-stop routing options can be set on each DestinationConfiguration.

@RequiresPermission(allOf = ["android.permission.ACCESS_FINE_LOCATION", "android.permission.ACCESS_COARSE_LOCATION", "android.permission.POST_NOTIFICATIONS"])
fun startNavigation(context: Context, destinationConfiguration: DestinationConfiguration, routingConfiguration: RoutingConfiguration = RoutingConfiguration())

Start a navigation with additional metadata.