java.lang.Object | |
↳ | com.google.android.gms.fitness.FitnessIntents |
Useful constants and methods for dealing with intents in the Fitness platform.
Constants | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
String | ACTION_TRACK | Broadcast action: the user has requested that an application starts or stops tracking their activity. | |||||||||
String | ACTION_VIEW | Broadcast action: the user has requested that an application show the value of a
particular fitness data type . |
|||||||||
String | ACTION_VIEW_GOAL | Broadcast action: the user has requested to view their current fitness goal. | |||||||||
String | EXTRA_DATA_SOURCE | Name for the optional parcelable intent extra containing the data source. | |||||||||
String | EXTRA_END_TIME | Name for the optional long intent extra containing the end time in milliseconds since epoch. | |||||||||
String | EXTRA_SESSION | Name for the parcelable intent extra containing the data session. | |||||||||
String | EXTRA_START_TIME | Name for the optional long intent extra containing the start time in milliseconds since epoch. | |||||||||
String | EXTRA_STATUS | Name for the String extra containing the status of an activity. | |||||||||
String | MIME_TYPE_ACTIVITY_PREFIX | The common prefix for Activity types. | |||||||||
String | MIME_TYPE_DATA_TYPE_PREFIX | The common prefix for Fitness data type MIME types. |
|||||||||
String | MIME_TYPE_SESSION_PREFIX | The common prefix for Session MIME types. |
|||||||||
String | STATUS_ACTIVE | Status indicating the activity has started. | |||||||||
String | STATUS_COMPLETED | Status indicating the activity has ended. |
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Returns the MIME type for a particular activity.
| |||||||||||
Retrieves the data source extra from the given intent.
| |||||||||||
Returns the MIME type for a particular
DataType . | |||||||||||
Retrieves the end time extra from the given intent.
| |||||||||||
Returns the MIME type which describes a Session for a particular activity.
| |||||||||||
Retrieves the start time extra from the given intent.
|
[Expand]
Inherited Methods | |||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
![]() |
Broadcast action: the user has requested that an application starts or stops tracking their activity. The intent will include the following attributes:
MIME_TYPE_ACTIVITY_PREFIX
followed by the
name of the activity. Apps can use a mimeType filter to listen only on activities
they can track.
Extra EXTRA_STATUS
: an extra indicating the current status of the
activity (active or completed).
Broadcast action: the user has requested that an application show the value of a
particular fitness data type
. This could be an intent to visualize
the current value of a data type (such as the current heart rate),
or the value of a data type over a period of time. The extras will determine what the
particular intent is.
MIME_TYPE_DATA_TYPE_PREFIX
followed by the name
of the data type the user would like to visualize. Apps can use a mimeType filter
to listen only on data types they can visualize. The MIME type can be generated by
getActivityMimeType(int)
.
Extra EXTRA_START_TIME
: an extra indicating the start time in
milliseconds since epoch, present if the user desires to visualize data over a period
of time. The start time can be extracted by getStartTime(android.content.Intent)
.
Extra EXTRA_END_TIME
: an extra indicating the end time in
milliseconds since epoch, present if the user desires to visualize data over a period
of time. If end time isn't specified, but start time is, then the end time used
should be "now". The end time can be extracted by getEndTime(android.content.Intent)
.
Broadcast action: the user has requested to view their current fitness goal.
Name for the optional parcelable intent extra containing the data source. It can be
extracted using getDataSource(android.content.Intent)
.
Name for the optional long intent extra containing the end time in milliseconds since
epoch. It can be extracted using getEndTime(android.content.Intent)
Name for the parcelable intent extra containing the data session. It can be
extracted using extract(android.content.Intent)
.
Name for the optional long intent extra containing the start time in milliseconds since
epoch. It can be extracted using getStartTime(android.content.Intent)
.
Name for the String extra containing the status of an activity. This is a mandatory
extra for ACTION_TRACK
intents, and holds one of the following values:
STATUS_ACTIVE
- the activity has started
STATUS_COMPLETED
- the activity has ended
The common prefix for Activity types. The MIME type for a particular activity type will be this prefix followed by the activity name.
The names for all activities are described inFitnessActivities
. The MIME
type can be computed from the activity's int constant using
getActivityMimeType(int)
The common prefix for Fitness data type
MIME types. The MIME
type for a particular data type will be this prefix followed by the data type name.
The common prefix for Session
MIME types. The MIME type for a particular
session will be this prefix followed by the session's activity name.
getActivity()
. The MIME
type can be computed from the activity type using getSessionMimeType(int)
Status indicating the activity has started.
Status indicating the activity has ended.
Returns the MIME type for a particular activity.
activity | one of the activities in FitnessActivities .
|
---|
Retrieves the data source extra from the given intent.
null
if not found
Returns the MIME type for a particular DataType
.
Retrieves the end time extra from the given intent.
-1
if not found
Returns the MIME type which describes a Session for a particular activity.
activity | one of the activities in FitnessActivities .
|
---|
Retrieves the start time extra from the given intent.
-1
if not found