Connect Android SDK reference: primary methods
The page describes the primary methods that you can use to manage and configure the Connect Android SDK.
Library management
Connect.enable
Connect.enable
Enables the Connect library.
Connect.enable(appKey: String?, postMessageUrl: String?)
Parameters:
appKey
(required) - the application key generated for your mobile app. It authorizes access to the library.postMessageUrl
(required) - the Connect domain assigned to your organization.
Connect.disable
Connect.disable
Disables the Connect library.
Connect.disable(): Boolean
Connect.isEnabled
Connect.isEnabled
Check if the Connect library is enabled.
Connect.isEnabled(): Boolean
Connect.getLibraryVersion
Connect.getLibraryVersion
Returns the library version.
Connect.getLibraryVersion(): String
Session management
Connect.startSession
Connect.startSession
Starts a new Connect session.
Connect.startSession(sessionID: String?): Boolean
Parameters:
sessionID
(optional) - the ID to assign to the session
Connect.getCurrentSessionId
Connect.getCurrentSessionId
Returns the ID of the current session.
Connect.getCurrentSessionId(): String
Connect.setCurrentSessionId
Connect.setCurrentSessionId
Sets the current session ID.
Connect.setCurrentSessionId(sessionId: String?)
Parameters:
sessionId
(required) - the ID assigned to the current Connect session.
Connect.createSessionId
Connect.createSessionId
Create a new session ID.
Connect.createSessionId(): String?
Connect.getTimestampFromSession
Connect.getTimestampFromSession
Get timestamp from current session.
Connect.getTimestampFromSession(): Long
Property and device management
Connect.getPropertyName
Connect.getPropertyName
Returns the property name from a view.
Connect.getPropertyName(
view: View?
): PropertyName
Connect.getDeviceId
Connect.getDeviceId
Returns the device ID.
Connect.getDeviceId(): String
Connect.setDeviceId
Connect.setDeviceId
Lets you set the device ID.
Connect.setDeviceId(
deviceId: String?
): Boolean
Config management
Connect.getConfigItemInt
Connect.getConfigItemInt
Get an integer config item.
Connect.getConfigItemInt(
key: String,
module: EOLifecycleObjectName
): Int
Connect.getConfigItemLong
Connect.getConfigItemLong
Get a long integer config item.
Connect.getConfigItemLong(
key: String,
module: EOLifecycleObjectName
): Long
Connect.getConfigItemDouble
Connect.getConfigItemDouble
Get a double config item.
Connect.getConfigItemDouble(
key: String,
module: EOLifecycleObjectName
): Double
Connect.getConfigItemBoolean
Connect.getConfigItemBoolean
Get a boolean config item.
Connect.getConfigItemBoolean(
key: String,
module: EOLifecycleObjectName
) : Boolean
Connect.getConfigItemString
Connect.getConfigItemString
Get a string config item.
Connect.getConfigItemString(
key: String,
module: EOLifecycleObjectName
) : String?
Connect.getConfigItemLongMSFromMinute
Connect.getConfigItemLongMSFromMinute
Get a long integer value in milliseconds from minutes.
Connect.getConfigItemLongMSFromMinute(
key: String,
module: EOLifecycleObjectName
): Long
Connect.updateConfig
Connect.updateConfig
Update a configuration item.
Connect.updateConfig(
key: String,
value: String,
module: EOLifecycleObjectName
): Boolean
Connect.getConfig
Connect.getConfig
Get configuration for a module.
Connect.getConfig(
module: EOLifecycleObjectName
): Map<String, String>?
Connect.appendConfig
Connect.appendConfig
Append configuration from a file.
Connect.appendConfig(
module: EOLifecycleObjectName,
fileName: String
): Boolean
Connect.updateConfig
Connect.updateConfig
Update configuration using JSONObject.
Connect.updateConfig(
module: EOLifecycleObjectName,
configurationObject: JSONObject
): Boolean
Lifecycle object management
Connect.getLifecycleObject
Connect.getLifecycleObject
Returns a lifecycle object by name.
Connect.getLifecycleObject(
name: String
): EOLifecycleObject?
Environmental Data Service
Connect.getEnvironmentalDataService
Connect.getEnvironmentalDataService
Get environmental data service.
Connect.getEnvironmentalDataService(): EnvironmentalDataService?
Updated about 1 month ago