Constants representing different user activities, such as walking, running, and cycling.
Activities are used in Sessions
,
DataTypes
and in read
queries
.
A 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
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
DataPoint.Builder.setActivityField(com.google.android.gms.fitness.data.Field,
String)
and Value.asActivity()
.
Constant Summary
String | AEROBICS | The user is performing aerobic exercises. |
String | ARCHERY | The user is doing archery, using a bow to shoot an arrow. |
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 | CROSSFIT | The user is performing Crossfit exercises. |
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 | ELEVATOR | The user is taking an elevator. |
String | ELLIPTICAL | The user is using an elliptical trainer or cross-trainer machine. |
String | ERGOMETER | The user is using an ergometer machine. |
String | ESCALATOR | The user is taking an escalator. |
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 | GUIDED_BREATHING | The user is engaging in guided breathing. |
String | GYMNASTICS | The user is practicing gymnastics. |
String | HANDBALL | The user is playing handball. |
String | HIGH_INTENSITY_INTERVAL_TRAINING | The user is performing high intensity interval training (HIIT). |
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 | INTERVAL_TRAINING | The user is performing interval training. |
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 | This constant is deprecated. Use the more
specific activity (for example RUNNING ,
WALKING ,
or
RUNNING_JOGGING ). |
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 | SLEEP_AWAKE | This constant is deprecated. No longer valid
activity for Sessions
or
activity segment . See SleepStages.AWAKE
and
DataType.TYPE_SLEEP_SEGMENT |
String | SLEEP_DEEP | This constant is deprecated. No longer valid
activity for Sessions
or
activity segment . SleepStages.SLEEP_DEEP
and
DataType.TYPE_SLEEP_SEGMENT |
String | SLEEP_LIGHT | This constant is deprecated. No longer valid
activity for Sessions
or
activity segments . See
SleepStages.SLEEP_LIGHT and
DataType.TYPE_SLEEP_SEGMENT |
String | SLEEP_REM | This constant is deprecated. No longer valid
activity for Sessions
or
activity segment . See SleepStages.SLEEP_REM
and
DataType.TYPE_SLEEP_SEGMENT |
String | SNOWBOARDING | The user is snowboarding. |
String | SNOWMOBILE | The user is on a snow mobile. |
String | SNOWSHOEING | The user is snow-shoeing. |
String | SOFTBALL | The user is playing softball. |
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 to indicate that the device angle relative to gravity changed significantly between the sample immediately before and immediately after the "tilting" sample. |
String | TREADMILL | This constant is deprecated. Use
WALKING_TREADMILL or
RUNNING_TREADMILL instead. |
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_PACED | The user is performing paced walking. |
String | WALKING_STROLLER | The user is walking while pushing a stroller. |
String | WALKING_TREADMILL | The user is walking on a treadmill |
String | WATER_POLO | The user is playing water polo. |
String | WEIGHTLIFTING | The user is weightlifting. |
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 Method Summary
static String |
Inherited Method Summary
Constants
public static final String AEROBICS
The user is performing aerobic exercises.
public static final String ARCHERY
The user is doing archery, using a bow to shoot an arrow.
public static final String BADMINTON
The user is playing badminton.
public static final String BASEBALL
The user is playing baseball.
public static final String BASKETBALL
The user is playing basketball.
public static final String BIATHLON
The user is practicing biathlon (combination of cross-country skiing and rifle shooting).
public static final String BIKING
The user is on a bicycle.
public static final String BIKING_HAND
The user is handcycling (or handbiking).
public static final String BIKING_MOUNTAIN
The user is mountain biking.
public static final String BIKING_ROAD
The user is cycling on a road or other smooth surface.
public static final String BIKING_SPINNING
The user is indoor cycling (spinning) on a specialized stationary bike.
public static final String BIKING_STATIONARY
The user is cycling on a stationary bike.
public static final String BIKING_UTILITY
The user is cycling as a means of transport.
public static final String BOXING
The user is boxing.
public static final String CALISTHENICS
The user is performing calisthenics exercises.
public static final String CIRCUIT_TRAINING
The user is performing circuit training exercises.
public static final String CRICKET
The user is playing cricket.
public static final String CROSSFIT
The user is performing Crossfit exercises.
public static final String CURLING
The user is practicing curling.
public static final String DANCING
The user is dancing.
public static final String DIVING
The user is diving into water, from a platform or spring board.
public static final String ELEVATOR
The user is taking an elevator.
public static final String ELLIPTICAL
The user is using an elliptical trainer or cross-trainer machine.
public static final String ERGOMETER
The user is using an ergometer machine.
public static final String ESCALATOR
The user is taking an escalator.
public static final String EXTRA_STATUS
Name for the String extra containing the status of an activity. This is a mandatory
extra for Fitness.ACTION_TRACK
intents, and holds one of the following values:
STATUS_ACTIVE
- the activity has startedSTATUS_COMPLETED
- the activity has ended
public static final String FENCING
The user is fencing.
public static final String FOOTBALL_AMERICAN
The user is playing American football (known as football in the United States).
public static final String FOOTBALL_AUSTRALIAN
The user is playing Australian-rules football.
public static final String FOOTBALL_SOCCER
The user is playing association football (known as soccer in the United States).
public static final String FRISBEE_DISC
The user is playing with a Frisbee disc.
public static final String GARDENING
The user is gardening.
public static final String GOLF
The user is playing golf.
public static final String GUIDED_BREATHING
The user is engaging in guided breathing.
public static final String GYMNASTICS
The user is practicing gymnastics.
public static final String HANDBALL
The user is playing handball.
public static final String HIGH_INTENSITY_INTERVAL_TRAINING
The user is performing high intensity interval training (HIIT).
public static final String HIKING
The user is hiking.
public static final String HOCKEY
The user is playing hockey.
public static final String HORSEBACK_RIDING
The user is horseback riding.
public static final String HOUSEWORK
The user is doing house work.
public static final String ICE_SKATING
The user is ice-skating.
public static final String INTERVAL_TRAINING
The user is performing interval training.
public static final String IN_VEHICLE
The user is in a vehicle, such as a car.
public static final String JUMP_ROPE
The user is jumping rope.
public static final String KAYAKING
The user is kayaking.
public static final String KETTLEBELL_TRAINING
The user is training with a kettlebell.
public static final String KICKBOXING
The user is kickboxing.
public static final String KICK_SCOOTER
The user is riding a kick scooter.
public static final String KITESURFING
The user is kite-surfing.
public static final String MARTIAL_ARTS
The user is practicing martial arts.
public static final String MEDITATION
The user is meditating.
public static final String MIME_TYPE_PREFIX
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_rope
getMimeType(String)
public static final String MIXED_MARTIAL_ARTS
The user is practicing mixed martial arts (MMA).
public static final String ON_FOOT
This constant is deprecated.
Use the more specific activity (for example RUNNING
,
WALKING
,
or
RUNNING_JOGGING
).
The user is on foot, walking, or running.
public static final String OTHER
The user is performing a generic fitness activity, which isn't classified.
Unlike unknown
,
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.
public static final String P90X
The user is performing P90X exercises.
public static final String PARAGLIDING
The user is paragliding.
public static final String PILATES
The user is performing pilates exercises.
public static final String POLO
The user is playing polo (team sport on horseback).
public static final String RACQUETBALL
The user is playing racquetball.
public static final String ROCK_CLIMBING
The user is rock climbing.
public static final String ROWING
The user is rowing.
public static final String ROWING_MACHINE
The user is using a rowing machine.
public static final String RUGBY
The user is playing rugby.
public static final String RUNNING
The user is running.
public static final String RUNNING_JOGGING
The user is jogging.
public static final String RUNNING_SAND
The user is running on sand.
public static final String RUNNING_TREADMILL
The user is running on a treadmill.
public static final String SAILING
The user is sailing.
public static final String SCUBA_DIVING
The user is scuba diving.
public static final String SKATEBOARDING
The user is skateboarding.
public static final String SKATING
The user is skating.
public static final String SKATING_CROSS
The user is cross skating.
public static final String SKATING_INDOOR
The user is skating in-doors.
public static final String SKATING_INLINE
The user is inline skating (roller-blading).
public static final String SKIING
The user is skiing.
public static final String SKIING_BACK_COUNTRY
The user is back-country skiing.
public static final String SKIING_CROSS_COUNTRY
The user is cross-country skiing.
public static final String SKIING_DOWNHILL
The user is downhill skiing.
public static final String SKIING_KITE
The user is kite skiing.
public static final String SKIING_ROLLER
The user is roller skiing (non-snow).
public static final String SLEDDING
The user is sledding.
public static final String SLEEP
The user is sleeping.
public static final String SLEEP_AWAKE
This constant is deprecated.
No longer valid activity for Sessions
or
activity segment
. See SleepStages.AWAKE
and
DataType.TYPE_SLEEP_SEGMENT
The user is in an awake period in the middle of a sleep session.
public static final String SLEEP_DEEP
This constant is deprecated.
No longer valid activity for Sessions
or
activity segment
. SleepStages.SLEEP_DEEP
and
DataType.TYPE_SLEEP_SEGMENT
The user is in a deep sleep cycle.
public static final String SLEEP_LIGHT
This constant is deprecated.
No longer valid activity for Sessions
or
activity segments
. See SleepStages.SLEEP_LIGHT
and
DataType.TYPE_SLEEP_SEGMENT
The user is in a light sleep cycle.
public static final String SLEEP_REM
This constant is deprecated.
No longer valid activity for Sessions
or
activity segment
. See SleepStages.SLEEP_REM
and
DataType.TYPE_SLEEP_SEGMENT
The user is in a REM sleep cycle. *
public static final String SNOWBOARDING
The user is snowboarding.
public static final String SNOWMOBILE
The user is on a snow mobile.
public static final String SNOWSHOEING
The user is snow-shoeing.
public static final String SOFTBALL
The user is playing softball.
public static final String SQUASH
The user is playing Squash.
public static final String STAIR_CLIMBING
The user is climbing stairs.
public static final String STAIR_CLIMBING_MACHINE
The user is using a stair-climbing machine.
public static final String STANDUP_PADDLEBOARDING
The user is on a stand-up paddle board.
public static final String STATUS_ACTIVE
Status indicating the activity has started.
public static final String STATUS_COMPLETED
Status indicating the activity has ended.
public static final String STILL
The user is still (not moving).
public static final String STRENGTH_TRAINING
The user is strength training.
public static final String SURFING
The user is surfing.
public static final String SWIMMING
The user is swimming.
public static final String SWIMMING_OPEN_WATER
The user is swimming in open waters.
public static final String SWIMMING_POOL
The user is swimming in a swimming pool.
public static final String TABLE_TENNIS
The user is playing table tennis (or ping-pong).
public static final String TEAM_SPORTS
The user is playing a team sport.
public static final String TENNIS
The user is playing tennis.
public static final String TILTING
This is a synthetic activity used 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.
public static final String TREADMILL
This constant is deprecated.
Use
WALKING_TREADMILL
or
RUNNING_TREADMILL
instead.
The user is on a treadmill (either walking or running).
public static final String UNKNOWN
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.
public static final String VOLLEYBALL
The user is playing volleyball.
public static final String VOLLEYBALL_BEACH
The user is playing beach volleyball.
public static final String VOLLEYBALL_INDOOR
The user is playing indoor volleyball.
public static final String WAKEBOARDING
The user is wake boarding.
public static final String WALKING
The user is walking.
public static final String WALKING_FITNESS
The user is walking at a moderate to high pace, for fitness.
public static final String WALKING_NORDIC
The user is performing Nordic walking (with poles).
public static final String WALKING_PACED
The user is performing paced walking.
public static final String WALKING_STROLLER
The user is walking while pushing a stroller.
public static final String WALKING_TREADMILL
The user is walking on a treadmill
public static final String WATER_POLO
The user is playing water polo.
public static final String WEIGHTLIFTING
The user is weightlifting.
public static final String WHEELCHAIR
The user is on a wheel chair.
public static final String WINDSURFING
The user is wind surfing.
public static final String YOGA
The user is performing Yoga poses.
public static final String ZUMBA
The users is performing Zumba exercises.
Public Methods
public static String getMimeType (String activity)
Returns the MIME type for a particular activity. The MIME type is used in intents
for viewing
a session
and tracking
an activity
.
Parameters
activity | The desired activity. |
---|