java.lang.Object | |
↳ | com.google.android.gms.fitness.FitnessActivities |
Constants representing different user activities, such as walking, running, and cycling.
Activities are used in Sessions
, DataTypes
and in
read queries
.
Session
associates an activity with all data that was recorded during a time interval,
such as heart rate samples
taken while the user was doing
aerobics
, or wheel RPM
measured
while biking
.
Activities be stored and read using the activity sample
and
activity segment
data types. When samples are stored,
these are automatically converted into segments by the platform's default data source.
When reading data, the activity segment
and
activity type
bucketing strategies can be used to aggregate
data by the activities happening at the time data was collected. This would allow, for instance,
aggregating step counts taken during running and those taken during walking separately,
or to query the average heart rate during each activity.
Each activity is represented by its name, which is a string constant. These constants are also
used in intents for tracking and visualizing activity data. Internally, activities are stored as
integers inside of DataPoint
for efficiency. You can convert between the
string and int representations for storage using setActivity(String)
and
asActivity()
.
A subset of the activities can be detected by
Activity Recognition
and are
listed in DetectedActivity
.
Constants | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
String | AEROBICS | The user is performing aerobic exercises. | |||||||||
String | BADMINTON | The user is playing badminton. | |||||||||
String | BASEBALL | The user is playing baseball. | |||||||||
String | BASKETBALL | The user is playing basketball. | |||||||||
String | BIATHLON | The user is practicing biathlon (combination of cross-country skiing and rifle shooting). | |||||||||
String | BIKING | The user is on a bicycle. | |||||||||
String | BIKING_HAND | The user is handcycling (or handbiking). | |||||||||
String | BIKING_MOUNTAIN | The user is mountain biking. | |||||||||
String | BIKING_ROAD | The user is cycling on a road or other smooth surface. | |||||||||
String | BIKING_SPINNING | The user is indoor cycling (spinning) on a specialized stationary bike. | |||||||||
String | BIKING_STATIONARY | The user is cycling on a stationary bike. | |||||||||
String | BIKING_UTILITY | The user is cycling as a means of transport. | |||||||||
String | BOXING | The user is boxing. | |||||||||
String | CALISTHENICS | The user is performing calisthenics exercises. | |||||||||
String | CIRCUIT_TRAINING | The user is performing circuit training exercises. | |||||||||
String | CRICKET | The user is playing cricket. | |||||||||
String | CURLING | The user is practicing curling. | |||||||||
String | DANCING | The user is dancing. | |||||||||
String | DIVING | The user is diving into water, from a platform or spring board. | |||||||||
String | ELLIPTICAL | The user is using an elliptical trainer or cross-trainer machine. | |||||||||
String | ERGOMETER | The user is using an ergometer machine. | |||||||||
String | EXTRA_STATUS | Name for the String extra containing the status of an activity. | |||||||||
String | FENCING | The user is fencing. | |||||||||
String | FOOTBALL_AMERICAN | The user is playing American football (known as football in the United States). | |||||||||
String | FOOTBALL_AUSTRALIAN | The user is playing Australian-rules football. | |||||||||
String | FOOTBALL_SOCCER | The user is playing association football (known as soccer in the United States). | |||||||||
String | FRISBEE_DISC | The user is playing with a Frisbee disc. | |||||||||
String | GARDENING | The user is gardening. | |||||||||
String | GOLF | The user is playing golf. | |||||||||
String | GYMNASTICS | The user is practicing gymnastics. | |||||||||
String | HANDBALL | The user is playing handball. | |||||||||
String | HIKING | The user is hiking. | |||||||||
String | HOCKEY | The user is playing hockey. | |||||||||
String | HORSEBACK_RIDING | The user is horseback riding. | |||||||||
String | HOUSEWORK | The user is doing house work. | |||||||||
String | ICE_SKATING | The user is ice-skating. | |||||||||
String | IN_VEHICLE | The user is in a vehicle, such as a car. | |||||||||
String | JUMP_ROPE | The user is jumping rope. | |||||||||
String | KAYAKING | The user is kayaking. | |||||||||
String | KETTLEBELL_TRAINING | The user is training with a kettlebell. | |||||||||
String | KICKBOXING | The user is kickboxing. | |||||||||
String | KICK_SCOOTER | The user is riding a kick scooter. | |||||||||
String | KITESURFING | The user is kite-surfing. | |||||||||
String | MARTIAL_ARTS | The user is practicing martial arts. | |||||||||
String | MEDITATION | The user is meditating. | |||||||||
String | MIME_TYPE_PREFIX | The common prefix for activity MIME types. | |||||||||
String | MIXED_MARTIAL_ARTS | The user is practicing mixed martial arts (MMA). | |||||||||
String | ON_FOOT | The user is on foot, walking or running. | |||||||||
String | OTHER | The user is performing a generic fitness activity, which isn't classified. | |||||||||
String | P90X | The user is performing P90X exercises. | |||||||||
String | PARAGLIDING | The user is paragliding. | |||||||||
String | PILATES | The user is performing pilates exercises. | |||||||||
String | POLO | The user is playing polo (team sport on horseback). | |||||||||
String | RACQUETBALL | The user is playing racquetball. | |||||||||
String | ROCK_CLIMBING | The user is rock climbing. | |||||||||
String | ROWING | The user is rowing. | |||||||||
String | ROWING_MACHINE | The user is using a rowing machine. | |||||||||
String | RUGBY | The user is playing rugby. | |||||||||
String | RUNNING | The user is running. | |||||||||
String | RUNNING_JOGGING | The user is jogging. | |||||||||
String | RUNNING_SAND | The user is running on sand. | |||||||||
String | RUNNING_TREADMILL | The user is running on a treadmill. | |||||||||
String | SAILING | The user is sailing. | |||||||||
String | SCUBA_DIVING | The user is scuba diving. | |||||||||
String | SKATEBOARDING | The user is skateboarding. | |||||||||
String | SKATING | The user is skating. | |||||||||
String | SKATING_CROSS | The user is cross skating. | |||||||||
String | SKATING_INDOOR | The user is skating in-doors. | |||||||||
String | SKATING_INLINE | The user is inline skating (roller-blading). | |||||||||
String | SKIING | The user is skiing. | |||||||||
String | SKIING_BACK_COUNTRY | The user is back-country skiing. | |||||||||
String | SKIING_CROSS_COUNTRY | The user is cross-country skiing. | |||||||||
String | SKIING_DOWNHILL | The user is downhill skiing. | |||||||||
String | SKIING_KITE | The user is kite skiing. | |||||||||
String | SKIING_ROLLER | The user is roller skiing (non-snow). | |||||||||
String | SLEDDING | The user is sledding. | |||||||||
String | SLEEP | The user is sleeping. | |||||||||
String | SNOWBOARDING | The user is snowboarding. | |||||||||
String | SNOWMOBILE | The user is on a snow mobile. | |||||||||
String | SNOWSHOEING | The user is snow-shoeing. | |||||||||
String | SQUASH | The user is playing Squash. | |||||||||
String | STAIR_CLIMBING | The user is climbing stairs. | |||||||||
String | STAIR_CLIMBING_MACHINE | The user is using a stair-climbing machine. | |||||||||
String | STANDUP_PADDLEBOARDING | The user is on a stand-up paddle board. | |||||||||
String | STATUS_ACTIVE | Status indicating the activity has started. | |||||||||
String | STATUS_COMPLETED | Status indicating the activity has ended. | |||||||||
String | STILL | The user is still (not moving). | |||||||||
String | STRENGTH_TRAINING | The user is strength training. | |||||||||
String | SURFING | The user is surfing. | |||||||||
String | SWIMMING | The user is swimming. | |||||||||
String | SWIMMING_OPEN_WATER | The user is swimming in open waters. | |||||||||
String | SWIMMING_POOL | The user is swimming in a swimming pool. | |||||||||
String | TABLE_TENNIS | The user is playing table tennis (or ping-pong). | |||||||||
String | TEAM_SPORTS | The user is playing a team sport. | |||||||||
String | TENNIS | The user is playing tennis. | |||||||||
String | TILTING |
This is a synthetic activity used by the
Activity Recognition API to
indicate that the device angle relative to gravity changed significantly between the sample
immediately before and immediately after the "tilting" sample.
|
|||||||||
String | TREADMILL | The user is on a treadmill (either walking or running). | |||||||||
String | UNKNOWN | The current activity is not known. | |||||||||
String | VOLLEYBALL | The user is playing volleyball. | |||||||||
String | VOLLEYBALL_BEACH | The user is playing beach volleyball. | |||||||||
String | VOLLEYBALL_INDOOR | The user is playing indoor volleyball. | |||||||||
String | WAKEBOARDING | The user is wake boarding. | |||||||||
String | WALKING | The user is walking. | |||||||||
String | WALKING_FITNESS | The user is walking at a moderate to high pace, for fitness. | |||||||||
String | WALKING_NORDIC | The user is performing Nordic walking (with poles). | |||||||||
String | WALKING_TREADMILL | The user is walking on a treadmill | |||||||||
String | WATER_POLO | The user is playing water polo. | |||||||||
String | WEIGHTLIFTING | The user is weight lifting. | |||||||||
String | WHEELCHAIR | The user is on a wheel chair. | |||||||||
String | WINDSURFING | The user is wind surfing. | |||||||||
String | YOGA | The user is performing Yoga poses. | |||||||||
String | ZUMBA | The users is performing Zumba exercises. |
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Returns the MIME type for a particular activity.
| |||||||||||
This method is deprecated.
Use
asActivity() instead. This method will be removed in
an upcoming release. New usage:
dataPoint.getValue(FIELD_ACTIVITY).asActivity(); | |||||||||||
This method is deprecated.
Use
setActivity(String) instead. This method will be removed in
an upcoming release. New usage:
dataPoint.getValue(FIELD_ACTIVITY).setActivity(activity); |
[Expand]
Inherited Methods | |||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
![]() |
The user is performing aerobic exercises.
The user is playing badminton.
The user is playing baseball.
The user is playing basketball.
The user is practicing biathlon (combination of cross-country skiing and rifle shooting).
The user is on a bicycle.
The user is handcycling (or handbiking).
The user is mountain biking.
The user is cycling on a road or other smooth surface.
The user is indoor cycling (spinning) on a specialized stationary bike.
The user is cycling on a stationary bike.
The user is cycling as a means of transport.
The user is boxing.
The user is performing calisthenics exercises.
The user is performing circuit training exercises.
The user is playing cricket.
The user is practicing curling.
The user is dancing.
The user is diving into water, from a platform or spring board.
The user is using an elliptical trainer or cross-trainer machine.
The user is using an ergometer machine.
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 user is fencing.
The user is playing American football (known as football in the United States).
The user is playing Australian-rules football.
The user is playing association football (known as soccer in the United States).
The user is playing with a Frisbee disc.
The user is gardening.
The user is playing golf.
The user is practicing gymnastics.
The user is playing handball.
The user is hiking.
The user is playing hockey.
The user is horseback riding.
The user is doing house work.
The user is ice-skating.
The user is in a vehicle, such as a car.
The user is jumping rope.
The user is kayaking.
The user is training with a kettlebell.
The user is kickboxing.
The user is riding a kick scooter.
The user is kite-surfing.
The user is practicing martial arts.
The user is meditating.
The common prefix for activity MIME types. The MIME type for a particular activity type will be this prefix followed by the activity name. Examples:
vnd.google.fitness.activity/walking vnd.google.fitness.activity/biking.mountain vnd.google.fitness.activity/jump_ropeThe names for all activities are described by the constants in this class. The full MIME type can be computed using
getMimeType(String)
The user is practicing mixed martial arts (MMA).
The user is on foot, walking or running. It's preferred to use the more specific activity when known.
The user is performing a generic fitness activity, which isn't classified.
Unlikeunknown
, which gives no indication as to what the user is doing,
"other" indicates that the user is performing a fitness-related activity.
The "other" activity is most useful to collect user input, for instance when an app wants to
give the user the ability to choose an activity that's not part of the regular activity set
for the app.
Note that an activity classified as "other" could represent any of the other activities in
this activity list, as well as an activity not in this list.
The user is performing P90X exercises.
The user is paragliding.
The user is performing pilates exercises.
The user is playing polo (team sport on horseback).
The user is playing racquetball.
The user is rock climbing.
The user is rowing.
The user is using a rowing machine.
The user is playing rugby.
The user is running.
The user is jogging.
The user is running on sand.
The user is running on a treadmill.
The user is sailing.
The user is scuba diving.
The user is skateboarding.
The user is skating.
The user is cross skating.
The user is skating in-doors.
The user is inline skating (roller-blading).
The user is skiing.
The user is back-country skiing.
The user is cross-country skiing.
The user is downhill skiing.
The user is kite skiing.
The user is roller skiing (non-snow).
The user is sledding.
The user is sleeping.
The user is snowboarding.
The user is on a snow mobile.
The user is snow-shoeing.
The user is playing Squash.
The user is climbing stairs.
The user is using a stair-climbing machine.
The user is on a stand-up paddle board.
Status indicating the activity has started.
Status indicating the activity has ended.
The user is still (not moving).
The user is strength training.
The user is surfing.
The user is swimming.
The user is swimming in open waters.
The user is swimming in a swimming pool.
The user is playing table tennis (or ping-pong).
The user is playing a team sport.
The user is playing tennis.
This is a synthetic activity used by the
Activity Recognition API
to
indicate that the device angle relative to gravity changed significantly between the sample
immediately before and immediately after the "tilting" sample. This often occurs when a
device is picked up from a desk or when a user who is sitting stands up.
The user is on a treadmill (either walking or running).
The current activity is not known. In this case, the activity could be any of the activities described in this class, or a completely different one.
The user is playing volleyball.
The user is playing beach volleyball.
The user is playing indoor volleyball.
The user is wake boarding.
The user is walking.
The user is walking at a moderate to high pace, for fitness.
The user is performing Nordic walking (with poles).
The user is walking on a treadmill
The user is playing water polo.
The user is weight lifting.
The user is on a wheel chair.
The user is wind surfing.
The user is performing Yoga poses.
The users is performing Zumba exercises.
Returns the MIME type for a particular activity. The MIME type is used in intents for
viewing a session
and
tracking an activity
.
activity | the desired activity. |
---|
This method is deprecated.
Use asActivity()
instead. This method will be removed in
an upcoming release. New usage:
dataPoint.getValue(FIELD_ACTIVITY).asActivity();
This method is deprecated.
Use setActivity(String)
instead. This method will be removed in
an upcoming release. New usage:
dataPoint.getValue(FIELD_ACTIVITY).setActivity(activity);