Field | Android Developers

Quicknav Quicknav
Links

- Google Play Developer Console
- Android Developers Blog
- About Android

Android Sites

- Android.com
- Android Developers
- Android Open Source Project

Language
close

- - About
  - Wear
  - TV
  - Auto
- - Get Started
  - Devices
  - Style
  - Patterns
  - Building Blocks
  - Downloads
  - Videos
- - Training
  - API Guides
  - Reference
  - Tools
  - Google Services
  - Samples
- - Google Play
  - Essentials
  - Get Users
  - Engage & Retain
  - Monetize
  - Analyze
  - Tools & Reference
  - Developer Stories

## Results

Loading...
Summary: Constants | Inherited Constants | Fields | Methods | Inherited Methods | [Expand All]
public final class

# Field

extends Object
implements Parcelable

java.lang.Object
↳ | com.google.android.gms.fitness.data.Field

## Class Overview

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 with `FIELD_`. 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)`.

## Summary

Constants
int | FORMAT_FLOAT | Format constant indicating the field holds float values.
int | FORMAT_INT32 | Format constant indicating the field holds integer values.

[Expand] Inherited Constants
From interface android.os.Parcelable
int | CONTENTS_FILE_DESCRIPTOR |
int | PARCELABLE_WRITE_RETURN_VALUE |

Fields
public static final Creator<Field> | CREATOR |
public static final Field | FIELD_ACCURACY | The accuracy of an accompanied value (such as location).
public static final Field | FIELD_ACTIVITY | An activity type of `FitnessActivities`, encoded as an integer for efficiency.
public static final Field | FIELD_ALTITUDE | An altitude of a location represented as a float, in meters above sea level.
public static final Field | FIELD_AVERAGE | An average value.
public static final Field | FIELD_BPM | A heart rate in beats per minute.
public static final Field | FIELD_CALORIES | Calories in kcal.
public static final Field | FIELD_CIRCUMFERENCE | Circumference of a body part, in centimeters.
public static final Field | FIELD_CONFIDENCE | The confidence of an accompanied value, specified as a value between 0.0 and 100.0.
public static final Field | FIELD_DISTANCE | A distance in meters.
public static final Field | FIELD_DURATION | A duration in milliseconds.
public static final Field | FIELD_HEIGHT | A height in meters.
public static final Field | FIELD_HIGH_LATITUDE | A high latitude of a location bounding box represented as a float, in degrees.
public static final Field | FIELD_HIGH_LONGITUDE | A high longitude of a location bounding box represented as a float, in degrees.
public static final Field | FIELD_LATITUDE | A latitude of a location represented as a float, in degrees.
public static final Field | FIELD_LONGITUDE | A longitude of a location represented as a float, in degrees.
public static final Field | FIELD_LOW_LATITUDE | A low latitude of a location bounding box represented as a float, in degrees.
public static final Field | FIELD_LOW_LONGITUDE | A low longitude of a location bounding box represented as a float, in degrees.
public static final Field | FIELD_MAX | A maximum value.
public static final Field | FIELD_MIN | A minimum value.
public static final Field | FIELD_PERCENTAGE | A percentage value, between 0 and 100.
public static final Field | FIELD_REVOLUTIONS | A count of revolutions.
public static final Field | FIELD_RPM | Revolutions per minute or rate per minute.
public static final Field | FIELD_SPEED | A speed in meter/sec.
public static final Field | FIELD_STEPS | A count of steps.
public static final Field | FIELD_WATTS | Power in watts.
public static final Field | FIELD_WEIGHT | A weight in kilograms.

Public Methods
int | describeContents()
boolean | equals(Object that)
int | getFormat() Returns the format of the field, as one of the format constant values.
String | getName() Returns the name of the field.
int | hashCode()
String | toString()
void | writeToParcel(Parcel dest, int flags)

[Expand] Inherited Methods
From class java.lang.Object
Object | clone()
boolean | equals(Object arg0)
void | finalize()
final Class<?> | getClass()
int | hashCode()
final void | notify()
final void | notifyAll()
String | toString()
final void | wait()
final void | wait(long arg0, int arg1)
final void | wait(long arg0)
From interface android.os.Parcelable
abstract int | describeContents()
abstract void | writeToParcel(Parcel arg0, int arg1)

## Constants

#### public static final int FORMAT_FLOAT

Format constant indicating the field holds float values.

Constant Value: 2 (0x00000002)

#### public static final int FORMAT_INT32

Format constant indicating the field holds integer values.

Constant Value: 1 (0x00000001)

## Fields

#### public static final Creator<Field> CREATOR

#### public static final Field FIELD_ACCURACY

The accuracy of an accompanied value (such as location).

#### public static final Field FIELD_ACTIVITY

An activity type of `FitnessActivities`, encoded as an integer for efficiency. The activity value should be stored using `setActivity(String)`, and read using `asActivity()`

#### public static final Field FIELD_ALTITUDE

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.

#### public static final Field FIELD_AVERAGE

An average value.

#### public static final Field FIELD_BPM

A heart rate in beats per minute.

#### public static final Field FIELD_CALORIES

Calories in kcal.

#### public static final Field FIELD_CIRCUMFERENCE

Circumference of a body part, in centimeters.

#### public static final Field FIELD_CONFIDENCE

The confidence of an accompanied value, specified as a value between 0.0 and 100.0.

#### public static final Field FIELD_DISTANCE

A distance in meters.

#### public static final Field FIELD_DURATION

A duration in milliseconds.

#### public static final Field FIELD_HEIGHT

A height in meters.

#### public static final Field FIELD_HIGH_LATITUDE

A high latitude of a location bounding box represented as a float, in degrees.

#### public static final Field FIELD_HIGH_LONGITUDE

A high longitude of a location bounding box represented as a float, in degrees.

#### public static final Field FIELD_LATITUDE

A latitude of a location represented as a float, in degrees.

#### public static final Field FIELD_LONGITUDE

A longitude of a location represented as a float, in degrees.

#### public static final Field FIELD_LOW_LATITUDE

A low latitude of a location bounding box represented as a float, in degrees.

#### public static final Field FIELD_LOW_LONGITUDE

A low longitude of a location bounding box represented as a float, in degrees.

#### public static final Field FIELD_MAX

A maximum value.

#### public static final Field FIELD_MIN

A minimum value.

#### public static final Field FIELD_PERCENTAGE

A percentage value, between 0 and 100.

#### public static final Field FIELD_REVOLUTIONS

A count of revolutions.

#### public static final Field FIELD_RPM

Revolutions per minute or rate per minute.

#### public static final Field FIELD_SPEED

A speed in meter/sec.

#### public static final Field FIELD_STEPS

A count of steps.

#### public static final Field FIELD_WATTS

Power in watts.

#### public static final Field FIELD_WEIGHT

A weight in kilograms.

## Public Methods

#### public int describeContents ()

#### public boolean equals (Object that)

#### public int getFormat ()

Returns the format of the field, as one of the format constant values.

#### public String getName ()

Returns the name of the field.

#### public int hashCode ()

#### public String toString ()

#### public void writeToParcel (Parcel dest, int flags)