java.lang.Object | |
↳ | com.google.android.gms.fitness.data.Field |
A field represents one dimension of a data type. It defines the name and format of data. Unlike data type names, field names are not namespaced, and only need to be unique within the data type.
This class contains constants representing the field names of common data types, each prefixed withFIELD_
. These can be used to access and set the fields via
DataPoint.getValue(Field)
.
Fields for custom data types can be created using
addField(String, int)
.
Constants | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
int | FORMAT_FLOAT | Format constant indicating the field holds float values. | |||||||||
int | FORMAT_INT32 | Format constant indicating the field holds integer values. | |||||||||
int | FORMAT_MAP | Format constant indicating the field holds a map of string keys to values. | |||||||||
int | FORMAT_STRING | Format constant indicating the field holds string values. | |||||||||
int | MEAL_TYPE_BREAKFAST | Meal type constant representing a breakfast meal. | |||||||||
int | MEAL_TYPE_DINNER | Meal type constant representing a dinner meal. | |||||||||
int | MEAL_TYPE_LUNCH | Meal type constant representing a lunch meal. | |||||||||
int | MEAL_TYPE_SNACK | Meal type constant representing a snack meal. | |||||||||
int | MEAL_TYPE_UNKNOWN | Meal type constant representing that the meal type is unknown. | |||||||||
String | NUTRIENT_CALCIUM | Calcium amount in milligrams. | |||||||||
String | NUTRIENT_CALORIES | Calories in kcal. | |||||||||
String | NUTRIENT_CHOLESTEROL | Cholesterol in milligrams. | |||||||||
String | NUTRIENT_DIETARY_FIBER | Dietary fiber in grams. | |||||||||
String | NUTRIENT_IRON | Iron amount in milligrams. | |||||||||
String | NUTRIENT_MONOUNSATURATED_FAT | Monounsaturated fat in grams. | |||||||||
String | NUTRIENT_POLYUNSATURATED_FAT | Polyunsaturated fat in grams. | |||||||||
String | NUTRIENT_POTASSIUM | Potassium in milligrams. | |||||||||
String | NUTRIENT_PROTEIN | Protein amount in grams. | |||||||||
String | NUTRIENT_SATURATED_FAT | Saturated fat in grams. | |||||||||
String | NUTRIENT_SODIUM | Sodium in milligrams. | |||||||||
String | NUTRIENT_SUGAR | Sugar amount in grams. | |||||||||
String | NUTRIENT_TOTAL_CARBS | Total carbohydrates in grams. | |||||||||
String | NUTRIENT_TOTAL_FAT | Total fat in grams. | |||||||||
String | NUTRIENT_TRANS_FAT | Trans fat in grams. | |||||||||
String | NUTRIENT_UNSATURATED_FAT | Unsaturated fat in grams. | |||||||||
String | NUTRIENT_VITAMIN_A | Vitamin A amount in International Units (IU). | |||||||||
String | NUTRIENT_VITAMIN_C | Vitamin C amount in milligrams. | |||||||||
int | RESISTANCE_TYPE_BARBELL | The user is using a barbell for resistance. | |||||||||
int | RESISTANCE_TYPE_BODY | The user is using their own body weight for resistance. | |||||||||
int | RESISTANCE_TYPE_CABLE | The user is using a cable for resistance. | |||||||||
int | RESISTANCE_TYPE_DUMBBELL | The user is using dumbells for resistance. | |||||||||
int | RESISTANCE_TYPE_KETTLEBELL | The user is using a kettlebell for resistance. | |||||||||
int | RESISTANCE_TYPE_MACHINE | The user is performing the exercise in a machine. | |||||||||
int | RESISTANCE_TYPE_UNKNOWN | The resistance type is unknown, unspecified, or not represented by any canonical values. |
[Expand]
Inherited Constants | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
![]() |
Fields | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
FIELD_ACCURACY | The accuracy of an accompanied value (such as location). | ||||||||||
FIELD_ACTIVITY | An activity type of FitnessActivities , encoded as an integer for efficiency. |
||||||||||
FIELD_ACTIVITY_CONFIDENCE | A map of activity to confidence, used in samples to show the different probabilitis of each activity. | ||||||||||
FIELD_ALTITUDE | An altitude of a location represented as a float, in meters above sea level. | ||||||||||
FIELD_AVERAGE | An average value. | ||||||||||
FIELD_BPM | A heart rate in beats per minute. | ||||||||||
FIELD_CALORIES | Calories in kcal. | ||||||||||
FIELD_CIRCUMFERENCE | Circumference of a body part, in centimeters. | ||||||||||
FIELD_CONFIDENCE | The confidence of an accompanied value, specified as a value between 0.0 and 100.0. | ||||||||||
FIELD_DISTANCE | A distance in meters. | ||||||||||
FIELD_DURATION | A duration in milliseconds. | ||||||||||
FIELD_EXERCISE | A workout exercise, as represented by one of the constants in WorkoutExercises . |
||||||||||
FIELD_FOOD_ITEM | The corresponding food item for a nutrition entry. | ||||||||||
FIELD_HEIGHT | A height in meters. | ||||||||||
FIELD_HIGH_LATITUDE | A high latitude of a location bounding box represented as a float, in degrees. | ||||||||||
FIELD_HIGH_LONGITUDE | A high longitude of a location bounding box represented as a float, in degrees. | ||||||||||
FIELD_LATITUDE | A latitude of a location represented as a float, in degrees. | ||||||||||
FIELD_LONGITUDE | A longitude of a location represented as a float, in degrees. | ||||||||||
FIELD_LOW_LATITUDE | A low latitude of a location bounding box represented as a float, in degrees. | ||||||||||
FIELD_LOW_LONGITUDE | A low longitude of a location bounding box represented as a float, in degrees. | ||||||||||
FIELD_MAX | A maximum value. | ||||||||||
FIELD_MEAL_TYPE | Type of meal, represented as the appropriate int constant. | ||||||||||
FIELD_MIN | A minimum value. | ||||||||||
FIELD_NUM_SEGMENTS | A number of segments. | ||||||||||
FIELD_NUTRIENTS | Nutrients ingested by the user, represented as a float map of nutrient key to quantity. | ||||||||||
FIELD_OCCURRENCES | How many occurrences of an event there were in a time range. | ||||||||||
FIELD_PERCENTAGE | A percentage value, between 0 and 100. | ||||||||||
FIELD_REPETITIONS | A count of repetitions for a single set of a workout exercise. | ||||||||||
FIELD_RESISTANCE | The resistance of the exercise (or weight), in kg. | ||||||||||
FIELD_RESISTANCE_TYPE | The type of resistance used in this exercise, represented as the appropriate int constant. | ||||||||||
FIELD_REVOLUTIONS | A count of revolutions. | ||||||||||
FIELD_RPM | Revolutions per minute or rate per minute. | ||||||||||
FIELD_SPEED | A speed in meter/sec. | ||||||||||
FIELD_STEPS | A count of steps. | ||||||||||
FIELD_STEP_LENGTH | Distance between steps in meters. | ||||||||||
FIELD_VOLUME | Volume in liters. | ||||||||||
FIELD_WATTS | Power in watts. | ||||||||||
FIELD_WEIGHT | A weight in kilograms. |
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Returns the format of the field, as one of the format constant values.
| |||||||||||
Returns the name of the field.
| |||||||||||
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
![]() | |||||||||||
![]() |
Format constant indicating the field holds float values.
Format constant indicating the field holds integer values.
Format constant indicating the field holds a map of string keys to values. The valid key space and units for the corresponding value should be documented as part of the data type definition.
Map values can be set using setKeyValue(String, float)
and read using
getKeyValue(String)
.
Keys should be kept small whenever possible. Data streams with large keys and high data frequency may be down sampled.
Format constant indicating the field holds string values. Strings should be kept small whenever possible. Data streams with large string values and high data frequency may be down sampled.
Meal type constant representing a breakfast meal.
Meal type constant representing a dinner meal.
Meal type constant representing a lunch meal.
Meal type constant representing a snack meal.
Meal type constant representing that the meal type is unknown.
Calcium amount in milligrams.
Calories in kcal.
Cholesterol in milligrams.
Dietary fiber in grams.
Iron amount in milligrams.
Monounsaturated fat in grams.
Polyunsaturated fat in grams.
Potassium in milligrams.
Protein amount in grams.
Saturated fat in grams.
Sodium in milligrams.
Sugar amount in grams.
Total carbohydrates in grams.
Total fat in grams.
Trans fat in grams.
Unsaturated fat in grams.
Vitamin A amount in International Units (IU). For converting from daily percentages, the FDA recommended 5000 IUs Daily Value can be used.
Vitamin C amount in milligrams.
The user is using a barbell for resistance. The specified resistance should include the weight of the bar, as well as weights added to both sides.
The user is using their own body weight for resistance.
The user is using a cable for resistance. When two cables are being used (one for each arm), the specified resistance should include the weight being pulled by one cable.
The user is using dumbells for resistance. The specified resistance should include the weight of a single dumbell.
The user is using a kettlebell for resistance.
The user is performing the exercise in a machine. The specified resistance should match the weight specified by the machine.
The resistance type is unknown, unspecified, or not represented by any canonical values.
An activity type of FitnessActivities
, encoded as an integer for efficiency. The
activity value should be stored using setActivity(String)
,
and read using asActivity()
A map of activity to confidence, used in samples to show the different probabilitis of each activity.
An example of the values for a likely detection of biking may be:
Note: the sum of confidences may add up to a value lower or higher than 100.
An altitude of a location represented as a float, in meters above sea level. Some location samples don't have an altitude value so this field might not be set.
The confidence of an accompanied value, specified as a value between 0.0 and 100.0.
A workout exercise, as represented by one of the constants in WorkoutExercises
.
A high latitude of a location bounding box represented as a float, in degrees.
A high longitude of a location bounding box represented as a float, in degrees.
A latitude of a location represented as a float, in degrees.
A longitude of a location represented as a float, in degrees.
A low latitude of a location bounding box represented as a float, in degrees.
A low longitude of a location bounding box represented as a float, in degrees.
Type of meal, represented as the appropriate int constant.
Nutrients ingested by the user, represented as a float map of nutrient key to quantity.
The valid keys of the map are listed in this class using the NUTRIENT_
prefix.
The documentation for each key describes the unit of its value.
How many occurrences of an event there were in a time range. For sample data types this should not be set to more than one.
A count of repetitions for a single set of a workout exercise.
The type of resistance used in this exercise, represented as the appropriate int constant.
Parameters | |
---|---|
that |
Object
|
Returns | |
---|---|
boolean |
Returns the format of the field, as one of the format constant values.
Returns | |
---|---|
int |
Returns the name of the field.
Returns | |
---|---|
String |
Returns | |
---|---|
int |
Returns | |
---|---|
Boolean |
Returns | |
---|---|
String |
Parameters | |
---|---|
dest |
Parcel
|
flags |
int
|