Intelligent Assistant
Chat with our virtual assistant to get answers promptly.
ActivityConversionInfo
A simple object that contains information about activity conversions.
Fields | Type |
conversionType | Int |
activityType | Int |
ActivityConversionData
A simple object that contains information about activity conversions.
Fields | Type |
conversionType | Int |
elapsedTimeFromReboot | Float |
conversionType | Int |
ActivityConversionRequest
An array that contains needed information for activity conversion requests. Each item of the must be in this object format:
Fields | Type |
conversionType | Int |
activityType | Int |
ActivityConversionResponse
A simple object that contains activity conversion response.
Fields | Type |
elapsedTimeFromReboot | Int |
mostActivityIdentification | ActivityIdentificationData |
activityIdentificationDatas | ActivityIdentificationData |
time | Int |
ActivityIdentificationData
A simple object that contains activity conversion data.
Fields | Type |
possibility | Int |
identificationActivity | Int |
ActivityIdentificationResponse
A simple object that contains activity identification response.
Fields | Type |
elapsedTimeFromReboot | Int |
mostActivityIdentification | Int |
activityIdentificationDatas | ActivityIdentificationData |
time | Int |
createActivityConversionUpdates(activityConversionRequests)
This API is used to activity conversions (entering and exit), for example, detecting user status change from walking to bicycling. After this, you can subscribe to updates using addActivityConversionEventListener(callback) function.
Parameter | Description |
activityConversionRequest | ActivityConversionRequest object. |
Return | Description |
promise | If the operation is successful, promise resolves to an object that contains a request code, like {"requestCode": "7"}. Otherwise it throws an error. |
createActivityIdentificationUpdates(intervalMillis)
This API is used to register for activity identification updates. After this, you can subscribe to updates using addActivityIdentificationEventListener(callback) function.
Parameter | Description |
intervalMillis | Interval for activity identification updates, in milliseconds. |
Return | Description |
promise | If the operation is successful, promise resolves to an object that contains a request code, like {"requestCode": "7"}. Otherwise it throws an error. |
deleteActivityConversionUpdates(requestCode)
This API is used to remove activity conversion updates by their request code.
Parameters | Description |
requestCode | A request code. |
Return | Description |
promise | If the operation is successful, true is returnd by the resolve. Otherwise an exception will be thrown. |
deleteActivityIdentificationUpdates(requestCode)
This API is used to remove activity indentification updates by their request code.
Parameters | Description |
requestCode | A request code. |
Return | Description |
promise | If the operation is successful, true is returnd by the resolve. Otherwise an exception will be thrown. |
requestPermission()
This API used to show the activity permission request dialog to user.
hasPermission()
This API is used to check if the app has the necessary permissions to gather activity information.
Return | Description |
promise | If the operation is successful, promise resolves to a boolean indicating that wheter the app has permissions to gather activity information or not. Otherwise it throws an error. |
addActivityIdentificationEventListener(callback)
This function takes a callback function that is continuosly called with activity identification data. You need to register for updates first by using the createActivityIdentificationUpdates function.
Parameters | Description |
callback | A callback function that takes a ActivityIdentificationData object as a parameter. |
removeActivityIdentificationEventListener(callback)
This function removes the event listener that is added by addActivityIdentificationEventListener.
Parameters | Description |
callback | Callback to remove. |
addActivityConversionEventListener(callback)
This function takes a callback function that is continuosly called with activity conversion data. You need to register for updates first by using the createActivityConversionUpdates function.
Parameters | Description |
callback | A callback function that takes a ActivityIdentificationData object as a parameter. |
removeActivityConversionEventListener(callback)
This function removes the event listener that is added by addActivityConversionEventListener.
Parameters | Description |
callback | Callback to remove. |
Name | Description |
ActivityConversions.VEHICLE | The device user is in a vehicle, such as car. |
ActivityConversions.BIKE | The device user is on a bicycle. |
ActivityConversions.FOOT | The device user is walking or running. |
ActivityConversions.RUNNING | The device user is running,it is a sub-activity of FOOT. |
ActivityConversions.STILL | The device user is still. |
ActivityConversions.TILTING | The device is in an obvious tilt status. |
ActivityConversions.OTHERS | The device is in other status. |
ActivityConversions.WALKING | The device user is walking. It is a sub-activity of FOOT. |
Activities.ENTER_ACTIVITY_CONVERSION | A user enters the given activity. The value is 0. |
Activities.EXIT_ACTIVITY_CONVERSION | A user exits the given activity. The value is 1. |