BringgSDKClient

You must instantiate an instance of the BringgSDKClient using the int method. You can also use real-time and device events implemented using init.

❗️

This version of Driver SDK for Android will be deprecated

The SDK is still active, however new functionality and bug fixes are no longer supported.
Stay tuned for the new version and documentation!

Use the init static method of the LeanBringgSDKClient to create an instance and initialize Bringg Driver SDK for Android. Implement event handling by defining the methods you require in the callbacks, listeners, and providers used by init for the following:

Methods

init

Use init to instantiate and instance of BringgSDKClient. A BringgSDKClient instance is required to implement Bringg Driver SDK for Android functionality in your own system. Using init, you can defining any or all of the callback, listener and provider methods passed through init method parameters.

📘

You must instantiate an instance of the BringgSDKClient

All Bringg Driver SDK for Android methods use the BringgSDKClient instantiated by init.

public static LeanBringgSDKClient init(
     @NotNull Context context,
     @NotNull LeanUserStatusProvider userStatusProvider,
     @NotNull UserEventsListener userEventsListener,
     @NotNull SecuredStorageProvider securedStorageProvider,
     @NotNull LeanBringgRealTimeEventCallback eventCallback)

Input Parameters

context

Context

NOT NULLABLE

Use to implement Context for a connection to the driver's device Android system and access system resources and classes.

eventCallback

LeanBringgRealTimeEventCallback

NOT NULLABLE

Use to implement a new instance of the LeanBringgRealTimeEventCallback callback interface and its methods to handle real-time events, including shift, task, and way point events.

securedStorageProvider

SecuredStorageProvider

NOT NULLABLE

Use to implement a new instance of the SecuredStorageProvider to manage secured device storage.

userEventsListener

UserEventsListener

NOT NULLABLE

Use to implement a new instance of the UserEventsListener to handle user events.

userStatusProvider

LeanUserStatusProvider

NOT NULLABLE

Use to implement a new instance of the LeanUserStatusProvider for driver device operations, including battary status and location operations.

📘

To Implement a New Instance of a Callback Interface

See Using Callback Interfaces for the syntax and examples.

Return Type

LeanBringgSDKClient

An instance of the LeanBringgSDKClient class that you can use for Bringg Driver SDK for Android method calls.

Context

Use to connect to the Android system, access system resource and classes.

context

Context

The Android system context.

LeanBringgRealTimeEventCallback

LeanBringgRealTimeEventCallback is a callback interface providing you with methods to capture and react to real-time events updating the bringg data models.
see more details in https://developers.bringg.com/docs/real-time-events

LeanUserStatusProvider

LeanUserStatusProvider is a Bringg Driver SDK for Android provider implementing interfaces and their methods for driver device status functions.

getBatteryStatus

Use to get the driver' device battery status.

int getBatteryStatus()

Input Parameters

None

Return Type

int

Indicates the device battery status. The values are:

  • 1 - unknown
  • 2 - charging
  • 3 - discharging
  • 4 - not charging
  • 5 - full

getLastLocation

Use to get the last location of the driver's device.

 @Nullable
Location getLastLocation()

Input Parameters

None

Return Type

Location

A reference to a Location data type containing the detailed information about the driver's location.

getSecondsSinceLastLocationReport

Use to the time (in seconds) since the driver's device last reported its location.

long getSecondsSinceLastLocationReport()

Input Parameters

None

Return Type

long

The number of seconds since the device's last location report to the server.

isLocationAvailable

Use to determine if the driver's device location is available.

boolean isLocationAvailable()

Input Parameters

None

Return Type

boolean

Indicates whether the user's (driver's) location is known. The values are:

  • false - the user's (driver's) location is not known
  • true - the user's (driver's) location is known

UserEventsListener

UserEventsListener is a Bringg Driver SDK for Android listener interface implementing methods for user event handling.

onUserLoggedOut

Invoked when a user (driver) logout event completes.

 void onUserLoggedOut()