AI-generated Key Takeaways
-
RidesharingDriverApiis the entry point for ridesharing functionalities within the Driver SDK. -
It provides methods to create and manage a singleton instance of the API.
-
Developers can access the
RidesharingVehicleReporterto report vehicle data to Fleet Engine. -
The API includes methods to get the Driver SDK version and clean up the instance before app termination.
Entry point into the DriverApi for the ridesharing vertical.
Public Method Summary
| synchronized static void |
clearInstance()
Cleans up instance of the RidesharingDriverApi before all references to it are
destroyed.
|
| static RidesharingDriverApi | |
| static String |
getDriverSdkVersion()
Returns the current Driver SDK version.
|
| static RidesharingDriverApi |
getInstance()
Returns the RidesharingDriverApi singleton.
|
| RidesharingVehicleReporter |
getRidesharingVehicleReporter()
Returns an instance of the RidesharingVehicleReporter, which reports vehicle
information to FleetEngine.
|
Inherited Method Summary
Public Methods
public static synchronized void clearInstance ()
Cleans up instance of the RidesharingDriverApi before all references to it are destroyed. It is the responsibility of the caller to ensure that all such references have been removed. Furthermore, there is no guarantee that subsequent calls to held references for objects obtained from this RidesharingDriverApi instance will continue to work without exceptions.
public static RidesharingDriverApi createInstance (DriverContext driverContext)
Creates a RidesharingDriverApi singleton instance.
Throws
| IllegalStateException | if a RidesharingDriverApi instance already exists. |
|---|---|
| NullPointerException | if DriverContext is null. |
public static String getDriverSdkVersion ()
Returns the current Driver SDK version.
public static RidesharingDriverApi getInstance ()
Returns the RidesharingDriverApi singleton. createInstance() must be called prior to getInstance(), otherwise null will be returned.
public RidesharingVehicleReporter getRidesharingVehicleReporter ()
Returns an instance of the RidesharingVehicleReporter, which reports vehicle information to FleetEngine.