Before using the Driver SDK, you must first initialize
the Navigation SDK and Driver SDK following these steps:

1. Obtain a `Navigator` object from the `NavigationApi`.

   ### Java

   ```java
   NavigationApi.getNavigator(
       this, // Activity
       new NavigationApi.NavigatorListener() {
         @Override
         public void onNavigatorReady(Navigator navigator) {
           // Keep a reference to the Navigator (used to configure and start nav)
           this.navigator = navigator;
         }
       }
   );
   ```

   ### Kotlin

   ```kotlin
   NavigationApi.getNavigator(
     this, // Activity
     object : NavigatorListener() {
       override fun onNavigatorReady(navigator: Navigator) {
         // Keep a reference to the Navigator (used to configure and start nav)
         this@myActivity.navigator = navigator
       }
     },
   )
   ```
2. Create a `DriverContext` object, populating the required fields. To
   initialize the `DriverContext` object, you must enter the **Project ID**
   of your Google Cloud Project as the `providerId`. For information
   on setting up the Google Cloud Project, see
   [Create your Fleet Engine project](https://developers.google.com/maps/documentation/mobility/fleet-engine/essentials/set-up-fleet/create-project.md.txt).

   ### Java

   ```java
   DriverContext driverContext = DriverContext.builder(application)
       .setProviderId(providerId)
       .setVehicleId(vehicleId)
       .setAuthTokenFactory(authTokenFactory)
       .setNavigator(navigator)
       .setRoadSnappedLocationProvider(
           NavigationApi.getRoadSnappedLocationProvider(application))
       .build();
   ```

   ### Kotlin

   ```kotlin
   val driverContext =
     DriverContext.builder(application)
       .setProviderId(providerId)
       .setVehicleId(vehicleId)
       .setAuthTokenFactory(authTokenFactory)
       .setNavigator(navigator)
       .setRoadSnappedLocationProvider(NavigationApi.getRoadSnappedLocationProvider(application))
       .build()
   ```
3. Use the `DriverContext` object to initialize the `*DriverApi`.

   ```java
   DeliveryDriverApi driverApi = DeliveryDriverApi.createInstance(driverContext);
   ```
4. Obtain the `DeliveryVehicleReporter` from the API object.
   (`DeliveryVehicleReporter` extends `NavigationVehicleReporter`.)

   ```java
   DeliveryVehicleReporter vehicleReporter = driverApi.getDeliveryVehicleReporter();
   ```

## Notes on SSL/TLS

Internally, the Driver SDK implementation uses
SSL/TLS to communicate securely with the Fleet Engine service. Android API
versions 23 or
earlier may require a `SecurityProvider` patch to communicate with the
server. For more information about working with SSL in Android, see
[Security GMS Provider](https://developer.android.com/training/articles/security-gms-provider).
The article also contains code samples for patching the security provider.

## What's next

[Get the vehicle ready](https://developers.google.com/maps/documentation/mobility/driver-sdk/scheduled/android/vehicle-ready.md.txt)