java.lang.Object | |
↳ | com.google.android.gms.location.DetectedActivity |
The detected activity of the device with an an associated confidence. See
ActivityRecognitionClient for details on how to obtain a
DetectedActivity
.
Constants | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
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 is on a user who is walking or running. | |||||||||
int | RUNNING | The device is on a user who is running. | |||||||||
int | STILL | The device is still (not moving). | |||||||||
int | TILTING | The device angle relative to gravity changed significantly. | |||||||||
int | UNKNOWN | Unable to detect the current activity. | |||||||||
int | WALKING | The device is on a user who is walking. |
[Expand]
Inherited Constants | |||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
From interface
android.os.Parcelable
|
Fields | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
CREATOR |
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Constructs a DetectedActivity.
|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Returns a value from 0 to 100 indicating the likelihood that the user is performing this
activity.
| |||||||||||
Returns the type of activity that was detected.
| |||||||||||
[Expand]
Inherited Methods | |||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.lang.Object
| |||||||||||||||||||||||||||||||||
From interface
android.os.Parcelable
|
The device is in a vehicle, such as a car.
The device is on a bicycle.
The device is on a user who is walking or running.
The device is on a user who is running. This is a sub-activity of ON_FOOT.
The device is still (not moving).
The device angle relative to gravity changed significantly. This often occurs when a device is picked up from a desk or a user who is sitting stands up.
Unable to detect the current activity.
The device is on a user who is walking. This is a sub-activity of ON_FOOT.
Constructs a DetectedActivity.
activityType | the activity that was detected. |
---|---|
confidence | value from 0 to 100 indicating how likely it is that the user is performing this activity. |
Returns a value from 0 to 100 indicating the likelihood that the user is performing this activity.
The larger the value, the more consistent the data used to perform the classification is with the detected activity.
This value will be <= 100. It means that larger values such as a confidence of >= 75 indicate that it's very likely that the detected activity is correct, while a value of <= 50 indicates that there may be another activity that is just as or more likely.
Multiple activities may have high confidence values. For example, the ON_FOOT may have a confidence of 100 while the RUNNING activity may have a confidence of 95. The sum of the confidences of all detected activities for a classification does not have to be <= 100 since some activities are not mutually exclusive (for example, you can be walking while in a bus) and some activities are hierarchical (ON_FOOT is a generalization of WALKING and RUNNING).
Returns the type of activity that was detected.