We use essential cookies for the website to function, as well as analytics cookies for analyzing and creating statistics of the website performance. To agree to the use of analytics cookies, click "Accept All". You can manage your preferences at any time by clicking "Cookie Settings" on the footer. More Information.

Only Essential Cookies
Accept All

ActivityIdentification

1 Data Types

  • ActivityConversionInfo

A simple object that contains information about activity conversions.

Expand

Fields

Type

conversionType

Int

activityType

Int

  • ActivityConversionData

A simple object that contains information about activity conversions.

Expand

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:

Expand

Fields

Type

conversionType

Int

activityType

Int

  • ActivityConversionResponse

A simple object that contains activity conversion response.

Expand

Fields

Type

elapsedTimeFromReboot

Int

mostActivityIdentification

ActivityIdentificationData

activityIdentificationDatas

ActivityIdentificationData

time

Int

  • ActivityIdentificationData

A simple object that contains activity conversion data.

Expand

Fields

Type

possibility

Int

identificationActivity

Int

  • ActivityIdentificationResponse

A simple object that contains activity identification response.

Expand

Fields

Type

elapsedTimeFromReboot

Int

mostActivityIdentification

Int

activityIdentificationDatas

ActivityIdentificationData

time

Int

2 Public Functions

  • 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.

Expand

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.

Expand

Parameter

Description

intervalMillis

Interval for activity identification updates, in milliseconds.

Expand

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.

Expand

Parameters

Description

requestCode

A request code.

Expand

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.

Expand

Parameters

Description

requestCode

A request code.

Expand

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.

Expand

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.

Expand

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.

Expand

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.

Expand

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.

Expand

Parameters

Description

callback

Callback to remove.

3 Constants

Expand

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.



This page may contain third-party content. For details, click here.
Search in References
Enter a keyword.