| CLASS info |
| public class DetectedActivity implements Parcelable |
| Class for detecting the activity type. |
| Name | Desc | |
| Creator<DetectedActivity> | CREATOR | Used for deserializing DetectedActivity. |
| Constructor name |
| DetectedActivity(int type, int confidence) This API is used to construct a DetectedActivity object. |
| Type | Name | Desc |
| int | IN_VEHICLE | The device is in a vehicle, such as a car. |
| int | ON_BICYCLE | The device is on a bicycle. |
| int | ON_FOOT | The device user is walking or running. |
| int | STILL | The device is still. |
| int | UNKNOWN | The current activity cannot be detected. |
| int | TILTING | The device has an obvious tilt change. |
| int | WALKING | The user of the device is walking. |
| int | RUNNING | The user of the device is running. |
| Return type | Method name |
| int | getConfidence() |
| int | getType() |
| constructor |
| public DetectedActivity(int type, int confidence) |
| This API is used to construct a DetectedActivity object. |
Parameters
| Parameter name | Parameter desc |
| type | Detected activity type. |
| confidence | Confidence. |
| 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 |
| 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
| type | desc |
| int | Confidence information. |
| Method |
| public int getType() |
| This API is used to obtain the type of the detected activity. |
Return
| type | desc |
| int | Activity type. |