CLASS info
public class DetectedActivity implements Parcelable
Class for detecting the activity type.

Field Summary

NameDesc
Creator<DetectedActivity>CREATORUsed for deserializing DetectedActivity.

Public Constructor Summary

Constructor name
DetectedActivity(int type, int confidence)
This API is used to construct a DetectedActivity object.

Constant Summary

TypeNameDesc
intIN_VEHICLEThe device is in a vehicle, such as a car.
intON_BICYCLEThe device is on a bicycle.
intON_FOOTThe device user is walking or running.
intSTILLThe device is still.
intUNKNOWNThe current activity cannot be detected.
intTILTINGThe device has an obvious tilt change.
intWALKINGThe user of the device is walking.
intRUNNINGThe user of the device is running.

Public Method Summary

Return typeMethod name
intgetConfidence()
intgetType()

Public Constructors

constructor
public DetectedActivity(int type, int confidence)
This API is used to construct a DetectedActivity object.

Parameters

Parameter nameParameter desc
typeDetected activity type.
confidenceConfidence.

Constants

Constant
public static final int IN_VEHICLE
The device is in a vehicle, such as a car.Constant Value:  0
Constant
public static final int ON_BICYCLE
The device is on a bicycle.Constant Value: 1
Constant
public static final int ON_FOOT
The device user is walking or running.Constant Value: 2
Constant
public static final int STILL
The device is still.Constant Value: 3
Constant
public static final int UNKNOWN
The current activity cannot be detected.Constant Value: 4
Constant
public static final int TILTING
The device has an obvious tilt change.Constant Value: 5
Constant
public static final int WALKING
The user of the device is walking.Constant Value: 7
Constant
public static final int RUNNING
The user of the device is running.Constant Value: 8

Public Methods

Method
public int getConfidence()
This API is used to obtain the confidence for the user to execute the activity. The confidence ranges from 0 to 100. A larger value indicates more reliable activity authenticity.

Return

typedesc
intConfidence information.
Method
public int getType()
This API is used to obtain the type of the detected activity.

Return

typedesc
intActivity type.