目录

ActivityIdentificationData

Class Info

public class ActivityIdentificationData implements Parcelable

Identified activity type.

Public Field Summary

Qualifier and Type

Field and Description

static final Creator<ActivityIdentificationData>

CREATOR

Used for deserializing ActivityIdentificationData.

static final int

BIKE

The device is on a bicycle.

static final int

FOOT

The device user is walking or running.

static final int

OTHERS

The current activity cannot be identified.

static final int

RUNNING

The device user is running. This is a sub activity of the FOOT activity.

static final int

STILL

The device is still.

static final int

VEHICLE

The device is in a vehicle, such as a car.

static final int

WALKING

The device user is walking. This is a sub activity of the FOOT activity.

Public Constructor Summary

Constructor Name

ActivityIdentificationData(int identificationActivity, int possibility)

Builder of ActivityIdentificationData.

Public Method Summary

Qualifier and Type

Method Name and Description

int

getIdentificationActivity()

Obtains the identified activity type.

int

getPossibility()

Obtains the confidence for a user to execute an activity. The value range is [0, 100].

static boolean

isValidType(int type)

Checks whether the identified activity type is valid.

void

setIdentificationActivity(int identificationActivity)

Sets the activity type.

void

setPossibility(int possibility)

Sets the confidence for a user to execute an activity. The value range is [0, 100].

Public Fields

[h2]CREATOR

Fields

public static final Creator<ActivityIdentificationData> CREATOR

Used for deserializing ActivityIdentificationData.

[h2]BIKE

Fields

public static final int BIKE

The device is on a bicycle.

BIKE: 101

For details about other constant values, please refer to Constant Values.

[h2]FOOT

Fields

public static final int FOOT

The device user is walking or running.

FOOT: 102

For details about other constant values, please refer to Constant Values.

[h2]OTHERS

Fields

public static final int OTHERS

The current activity cannot be identified.

OTHERS: 104

For details about other constant values, please refer to Constant Values.

[h2]RUNNING

Fields

public static final int RUNNING

The device user is running. This is a sub activity of the FOOT activity.

RUNNING: 108

For details about other constant values, please refer to Constant Values.

[h2]STILL

Fields

public static final int STILL

The device is still.

STILL: 103

For details about other constant values, please refer to Constant Values.

[h2]VEHICLE

Fields

public static final int VEHICLE

The device is in a vehicle, such as a car.

VEHICLE: 100

For details about other constant values, please refer to Constant Values.

[h2]WALKING

Fields

public static final int WALKING

The device user is walking. This is a sub activity of the FOOT activity.

WALKING: 107

For details about other constant values, please refer to Constant Values.

Public Constructors

[h2]ActivityIdentificationData(int identificationActivity, int possibility)

Constructor

public ActivityIdentificationData(int identificationActivity, int possibility)

Builder of ActivityIdentificationData. If the value of possibility is not within the range [0, 100], an error indicating invalid parameter will be thrown.

Parameters

Name

Description

identificationActivity

Detected activity type. For details, please refer to Constant Values.

possibility

Confidence. The value range is [0, 100].

Throws

Name

Description

ApiException

If the value of possibility is not within the range [0, 100].

Public Methods

[h2]getIdentificationActivity

Method

public int getIdentificationActivity()

Obtains the identified activity type.

Returns

Type

Description

int

Activity type. For details, please refer to Constant Values.

[h2]getPossibility

Method

public int getPossibility()

Obtains the confidence for a user to execute an activity. The value range is [0, 100]. A larger value indicates more reliable activity authenticity.

Returns

Type

Description

int

Confidence.

[h2]isValidType

Method

public static boolean isValidType(int type)

Checks whether the identified activity type is valid.

Parameters

Name

Description

type

Activity type. For details, please refer to Constant Values.

Returns

Type

Description

boolean

true if the activity type is valid; false otherwise.

[h2]setIdentificationActivity

Method

public void setIdentificationActivity(int identificationActivity)

Sets the activity type.

Parameters

Name

Description

identificationActivity

Activity type. For details, please refer to Constant Values.

[h2]setPossibility

Method

public void setPossibility(int possibility)

Sets the confidence for a user to execute an activity. The value range is [0, 100].

Parameters

Name

Description

possibility

Confidence. The value range is [0, 100].

Throws

Name

Description

ApiException

If the value of possibility is not within the range [0, 100].