public class ZendriveConfiguration extends Object
Zendrive.setup(android.content.Context, com.zendrive.sdk.ZendriveConfiguration, java.lang.Class<? extends com.zendrive.sdk.ZendriveBroadcastReceiver>, java.lang.Class<? extends com.zendrive.sdk.ZendriveNotificationProvider>, com.zendrive.sdk.ZendriveOperationCallback)
.
It contains properties like the sdk key, driver id, driver attributes etc.Constructor and Description |
---|
ZendriveConfiguration(JSONObject jsonObject)
Creates a ZendriveConfiguration from its json representation.
|
ZendriveConfiguration(String sdkKey,
String driverId)
Creates a ZendriveConfiguration with the given sdk key and a driver id.
|
ZendriveConfiguration(String sdkKey,
String driverId,
ZendriveDriveDetectionMode driveDetectionMode)
Creates a ZendriveConfiguration with the given sdk key, driver id and drive
detection mode.
|
ZendriveConfiguration(String sdkKey,
String driverId,
ZendriveDriveDetectionMode driveDetectionMode,
ZendriveRegion region)
Creates a ZendriveConfiguration with the given sdk key, driver id, drive
detection mode and region type.
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object o) |
ZendriveDriverAttributes |
getDriverAttributes()
Returns the additional attributes of the current driver.
|
String |
getDriverId()
Returns the unique ID of the driver using this application.
|
boolean |
getEnabledBluetoothDriveStart()
Returns a boolean indicating if the app supports Bluetooth Drive Start.
|
boolean |
getImplementsMultipleAccidentCallbacks()
Returns a boolean indicating if the app supports receiving multiple callbacks.
|
ZendriveRegion |
getRegion()
Returns the region associated with the current driver.
|
String |
getSdkKey()
Returns the Zendrive sdk key used by this application.
|
ZendriveDriveDetectionMode |
getZendriveDriveDetectionMode()
Returns the drive detection mode specified for the Zendrive SDK.
|
int |
hashCode() |
void |
setDriveDetectionMode(ZendriveDriveDetectionMode mode)
Set the drive detection mode of this configuration.
|
void |
setDriverAttributes(ZendriveDriverAttributes driverAttributes)
Set the additional attributes of the current driver.
|
void |
setEnabledBluetoothDriveStart(boolean enabledBluetoothDriveStart)
Set this property to true if the app supports Bluetooth Drive Start.
|
void |
setImplementsMultipleAccidentCallbacks(boolean implementsMultipleAccidentCallbacks)
Set this property to true if the app supports receiving multiple callbacks.
|
void |
setRegion(ZendriveRegion region)
Set the region type of this configuration.
|
JSONObject |
toJson()
Return the json representation of this object.
|
public ZendriveConfiguration(String sdkKey, String driverId)
Auto drive detection is on
when Zendrive is
Zendrive.setup(android.content.Context, com.zendrive.sdk.ZendriveConfiguration, java.lang.Class<? extends com.zendrive.sdk.ZendriveBroadcastReceiver>, java.lang.Class<? extends com.zendrive.sdk.ZendriveNotificationProvider>, com.zendrive.sdk.ZendriveOperationCallback)
with this configuration.sdkKey
- The Zendrive sdk key for this application. The sdk key is available from the
Zendrive developer
portal. This cannot be null.driverId
- The Id of the driver currently using this application. Each driver using the
application needs a unique Id. This same Id will be used in Zendrive driver
analytics services like the dashboard and API. The driver Id may be upto 64
characters long. Additionally, the driver Id needs to be websafe. You can use
Zendrive.isValidInputParameter(java.lang.String)
to validate the driver Id. Passing an
invalid id will cause the Zendrive SDK setup to fail. This cannot be null.NullPointerException
- if sdkKey
or driverId
is null.public ZendriveConfiguration(String sdkKey, String driverId, ZendriveDriveDetectionMode driveDetectionMode)
sdkKey
- The Zendrive sdk key for this application. The sdk key is available
from the Zendrive developer portal . This cannot be
null.driverId
- The Id of the driver currently using this application. Each driver
using the application needs a unique Id. This same Id will be used
in Zendrive driver analytics services like the dashboard and API.
The driver Id may be upto 64 characters long. Additionally, the
driver Id needs to be websafe. You can use Zendrive.isValidInputParameter(java.lang.String)
to validate the driver Id. Passing
an invalid id will cause the Zendrive SDK setup to fail. This
cannot be null.driveDetectionMode
- The drive detection mode of the Zendrive SDK. Cannot be null.NullPointerException
- if sdkKey
or driverId
or
driveDetectionMode
is null.public ZendriveConfiguration(String sdkKey, String driverId, ZendriveDriveDetectionMode driveDetectionMode, ZendriveRegion region)
sdkKey
- The Zendrive sdk key for this application. The sdk key is available
from the Zendrive developer portal . This cannot be
null.driverId
- The Id of the driver currently using this application. Each driver
using the application needs a unique Id. This same Id will be used
in Zendrive driver analytics services like the dashboard and API.
The driver Id may be upto 64 characters long. Additionally, the
driver Id needs to be websafe. You can use Zendrive.isValidInputParameter(java.lang.String)
to validate the driver Id. Passing
an invalid id will cause the Zendrive SDK setup to fail. This
cannot be null.driveDetectionMode
- The drive detection mode of the Zendrive SDK. Cannot be null.region
- Region for a driver, whose default state of region would be
US until specified.NullPointerException
- if sdkKey
or driverId
or
driveDetectionMode
or region
is null.public ZendriveConfiguration(JSONObject jsonObject) throws JSONException
jsonObject
- The json representation of a ZendriveConfiguration.JSONException
- if the json could not be parsed properly.public String getSdkKey()
public String getDriverId()
public ZendriveDriveDetectionMode getZendriveDriveDetectionMode()
public ZendriveDriverAttributes getDriverAttributes()
public void setDriverAttributes(ZendriveDriverAttributes driverAttributes)
driverAttributes
- The additional attributes of the current driver. If null, all the
driver attributes are reset.public void setDriveDetectionMode(ZendriveDriveDetectionMode mode)
mode
- The ZendriveDriveDetectionMode.public ZendriveRegion getRegion()
public void setRegion(ZendriveRegion region)
region
- The ZendriveRegion.public boolean getImplementsMultipleAccidentCallbacks()
public boolean getEnabledBluetoothDriveStart()
public void setImplementsMultipleAccidentCallbacks(boolean implementsMultipleAccidentCallbacks)
ZendriveBroadcastReceiver.onPotentialAccident(android.content.Context, com.zendrive.sdk.AccidentInfo)
. This callback can serve as an early
indication of a collision that might have happened. A potential accident event sent this way
might be invalidated by the final callback in ZendriveBroadcastReceiver.onAccident(android.content.Context, com.zendrive.sdk.AccidentInfo)
.
Such a callback will have AccidentInfo.confidenceNumber
set to 0 and
AccidentInfo.confidence
set to INVALID
.
Default value is false
.public void setEnabledBluetoothDriveStart(boolean enabledBluetoothDriveStart)
ZendriveBroadcastReceiver.onDriveStart(android.content.Context, com.zendrive.sdk.DriveStartInfo)
callback whenever a successful bluetooth connection is established with an already associated
vehicle. If the vehicle is not already associated, call
ZendriveVehicleTagging.associateVehicle(android.content.Context, com.zendrive.sdk.ZendriveVehicleInfo)
before connecting the device to the vehicle
via Bluetooth. This feature needs ZendriveDriveDetectionMode
to be
ZendriveDriveDetectionMode.AUTO_ON
.
Default value is false
. Please contact Zendrive Support in case the feature is not
enabled.enabledBluetoothDriveStart
- public JSONObject toJson()