java.lang.Object | |
↳ | com.google.android.gms.location.ActivityRecognitionResult |
Result of an activity recognition.
It contains a list of activities that a user may have been doing at a particular time. The activities are sorted by the most probable activity first. A confidence is associated with each activity which indicates how likely that activity is.
getMostProbableActivity()
will return the most probable activity of
the user at the time that activity recognition was run.
Constants | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
String | EXTRA_ACTIVITY_RESULT |
[Expand]
Inherited Constants | |||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
From interface
android.os.Parcelable
|
Fields | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
CREATOR |
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Constructs an ActivityRecognitionResult.
| |||||||||||
Constructs an ActivityRecognitionResult from a single activity.
|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Extracts the ActivityRecognitionResult from an Intent.
| |||||||||||
Returns the confidence of the given activity type.
| |||||||||||
Returns the elapsed real time of this detection in milliseconds since
boot, including time spent in sleep as obtained by
SystemClock.elapsedRealtime().
| |||||||||||
Returns the most probable activity of the user.
| |||||||||||
Returns the list of activities that where detected with the confidence
value associated with each activity.
| |||||||||||
Returns the UTC time of this detection, in milliseconds since January 1,
1970.
| |||||||||||
Returns true if an Intent contains an ActivityRecognitionResult.
| |||||||||||
[Expand]
Inherited Methods | |||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.lang.Object
| |||||||||||||||||||||||||||||||||
From interface
android.os.Parcelable
|
Constructs an ActivityRecognitionResult.
probableActivities | the activities that where detected, sorted by confidence (most probable first). |
---|---|
time | the UTC time of this detection, in milliseconds since January 1, 1970. |
elapsedRealtimeMillis | milliseconds since boot |
Constructs an ActivityRecognitionResult from a single activity.
mostProbableActivity | the most probable activity of the device. |
---|---|
time | the UTC time of this detection, in milliseconds since January 1, 1970. |
elapsedRealtimeMillis | milliseconds since boot. |
Extracts the ActivityRecognitionResult from an Intent.
This is a utility function which extracts the ActivityRecognitionResult from the extras of an Intent that was sent from the activity detection service.
null
if the intent doesn't
contain an ActivityRecognitionResult.
Returns the confidence of the given activity type.
Returns the elapsed real time of this detection in milliseconds since boot, including time spent in sleep as obtained by SystemClock.elapsedRealtime().
Returns the list of activities that where detected with the confidence value associated with each activity. The activities are sorted by most probable activity first.
The sum of confidence values for the activities is guaranteed to be <= 100.
Returns the UTC time of this detection, in milliseconds since January 1, 1970.
Returns true if an Intent contains an ActivityRecognitionResult.
This is a utility function that can be called from inside an intent receiver to make sure the received intent is from activity recognition.