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.
|
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.
|
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.
|
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(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 JSONObject toJson()