java.lang.Object | |
↳ | com.google.android.gms.fitness.data.HealthDataTypes |
Predefined health-specific data types. While read-only access to these data types is available to all developers (with user consent), developers need to be whitelisted in order to write to them. Please see the developer docs for more information.
This class defines additional constants representing standardized data types beyond those in
DataType
for health data. See the DataType
class for other constants and how to
use DataType
objects.
Fields | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
AGGREGATE_BASAL_BODY_TEMPERATURE_SUMMARY | In the com.google.body.temperature.basal.summary data type, each data point
represents the basal body temperature of the user over a time interval. |
||||||||||
AGGREGATE_BLOOD_GLUCOSE_SUMMARY | In the com.google.blood_glucose.summary data type, each data point represents the
blood pressure of the user of a time interval. |
||||||||||
AGGREGATE_BLOOD_PRESSURE_SUMMARY | In the com.google.blood_pressure.summary data type, each data point represents the
blood pressure of the user of a time interval. |
||||||||||
AGGREGATE_BODY_TEMPERATURE_SUMMARY | In the com.google.body.temperature.summary data type, each data point represents the
body temperature of the user over a time interval. |
||||||||||
AGGREGATE_OXYGEN_SATURATION_SUMMARY | In the com.google.oxygen_saturation.summary data type, each data point represents the
blood oxygen saturation of the user of a time interval. |
||||||||||
TYPE_BASAL_BODY_TEMPERATURE | In the com.google.body.temperature.basal data type, each data point represents
a single instantaneous measurement of basal body temperature. |
||||||||||
TYPE_BLOOD_GLUCOSE | In the com.google.blood_glucose data type, each data point represents a single
instantaneous blood glucose reading. |
||||||||||
TYPE_BLOOD_PRESSURE | In the com.google.blood_pressure data type, each data point represents a single
instantaneous blood pressure reading. |
||||||||||
TYPE_BODY_TEMPERATURE | In com.google.body.temperature , each data point represents a single instantaneous
body temperature measurement. |
||||||||||
TYPE_CERVICAL_MUCUS | In type com.google.cervical_mucus data type, each data point represents a user report
of their cervical mucus. |
||||||||||
TYPE_CERVICAL_POSITION | In the com.google.cervical_position data type, each data point represents a report
of the user's cervical position. |
||||||||||
TYPE_MENSTRUATION | In the com.google.menstruation data type, each data point represents a report of
the user's menstrual flow. |
||||||||||
TYPE_OVULATION_TEST | In the com.google.ovulation_test data type, each data point represents the results
of an ovulation test. |
||||||||||
TYPE_OXYGEN_SATURATION | In the com.google.oxygen_saturation data type, each data point represents a single
instantaneous blood oxygen saturation reading. |
||||||||||
TYPE_VAGINAL_SPOTTING | In com.google.vaginal_spotting , each data point represents an occurrence of vaginal
spotting. |
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
![]() |
In the com.google.body.temperature.basal.summary
data type, each data point
represents the basal body temperature of the user over a time interval.
Each data point contains the average, minimum and maximum basal body temperature of the user over the time interval.
It also contains the location the measurement was made on the body, if the measurement location was the same for all data points in the time interval.
In the com.google.blood_glucose.summary
data type, each data point represents the
blood pressure of the user of a time interval.
Each data point contains the average, minimum and maximum blood glucose over the time interval.
It also contains the temporal relation to a meal, temporal relation to sleep and specimen source if each field is set to the same value for all measurements during the time interval, or unset if the field value isn't the same across all measurements.
In the com.google.blood_pressure.summary
data type, each data point represents the
blood pressure of the user of a time interval.
Each data point has eight fields:
In the com.google.body.temperature.summary
data type, each data point represents the
body temperature of the user over a time interval.
Each data point contains the average, minimum and maximum body temperature of the user over the time interval.
It also contains the location the measurement was made on the body, if the measurement location was the same for all data points in the time interval.
In the com.google.oxygen_saturation.summary
data type, each data point represents the
blood oxygen saturation of the user of a time interval.
Each data point contains nine fields:
In the com.google.body.temperature.basal
data type, each data point represents
a single instantaneous measurement of basal body temperature.
The data point contains fields for body temperature and the location of the measurement. Specifying the location of measurement is optional.
The body temperature is measured in degrees Celsius.
If specified, the measurement location must have one of the values listed in
FIELD_BODY_TEMPERATURE_MEASUREMENT_LOCATION
.
Sample code for creating a data point with all fields:
DataSource basalBodyTemperatureDataSource = new DataSource.Builder() .setDataType(TYPE_BASAL_BODY_TEMPERATURE) ... .build(); DataPoint basalBodyTemperature = DataPoint.create(basalBodyTemperatureDataSource); basalBodyTemperature.setTimestamp(now.getMillis(), MILLISECONDS); basalBodyTemperature.getValue(FIELD_BODY_TEMPERATURE).setFloat(37.0f); basalBodyTemperature.getValue(FIELD_BODY_TEMPERATURE_MEASUREMENT_LOCATION) .setInt(BODY_TEMPERATURE_MEASUREMENT_LOCATION_FINGER);
In the com.google.blood_glucose
data type, each data point represents a single
instantaneous blood glucose reading.
The data point contains fields for the blood glucose concentration, temporal relationships to meals and sleep, and the source of the specimen which was measured. All fields except blood glucose concentration are optional.
The blood glucose concentration is measured in mmol/L. 1 mmol/L is equivalent to 18 mg/dL.
If specified, temporal relation to meal must have one of the values listed in
FIELD_TEMPORAL_RELATION_TO_MEAL
.
Meal type must have one of the values listed in
FIELD_MEAL_TYPE
. If
the meal type is not known, use MEAL_TYPE_UNKNOWN.
If specified, temporal relation to sleep must have one of the values listed in
FIELD_TEMPORAL_RELATION_TO_SLEEP
.
If specified, blood glucose specimen source must have one of the values listed in
FIELD_BLOOD_GLUCOSE_SPECIMEN_SOURCE
.
Sample code for creating a data point with all fields:
DataSource bloodGlucoseSource = new DataSource.Builder() .setDataType(TYPE_BLOOD_GLUCOSE) ... .build(); DataPoint bloodGlucose = DataPoint.create(bloodGlucoseSource); bloodGlucose.setTimestamp(now.getMillis(), MILLISECONDS); bloodGlucose.getValue(FIELD_BLOOD_GLUCOSE_LEVEL).setFloat(5.0f); bloodGlucose.getValue(FIELD_TEMPORAL_RELATION_TO_MEAL) .setInt(FIELD_TEMPORAL_RELATION_TO_MEAL_BEFORE_MEAL); bloodGlucose.getValue(FIELD_MEAL_TYPE).setInt(MEAL_TYPE_BREAKFAST); bloodGlucose.getValue(FIELD_TEMPORAL_RELATION_TO_SLEEP) .setInt(TEMPORAL_RELATION_TO_SLEEP_ON_WAKING); bloodGlucose.getValue(FIELD_BLOOD_GLUCOSE_SPECIMEN_SOURCE) .setInt(BLOOD_GLUCOSE_SPECIMEN_SOURCE_CAPILLARY_BLOOD);
In the com.google.blood_pressure
data type, each data point represents a single
instantaneous blood pressure reading.
The data point contains fields for the systolic and diastolic pressure, body position when the reading was taken and location on the body where the measurement was performed. All fields except systolic and diastolic pressure are optional.
The systolic and diastolic pressures are measured in mmHg.
If specified, body position must have one of the values listed in
FIELD_BODY_POSITION
.
If specified, measurement location must have one of the values listed in
FIELD_BLOOD_PRESSURE_MEASUREMENT_LOCATION
.
Sample code for creating a data point with all fields:
DataSource bloodPressureSource = new DataSource.Builder() .setDataType(TYPE_BLOOD_PRESSURE) ... .build(); DataPoint bloodPressure = DataPoint.create(bloodPressureSource); bloodPressure.setTimestamp(now.getMillis(), MILLISECONDS); bloodPressure.getValue(FIELD_BLOOD_PRESSURE_SYSTOLIC).setFloat(120.0f); bloodPressure.getValue(FIELD_BLOOD_PRESSURE_DIASTOLIC).setFloat(80.0f); bloodPressure.getValue(FIELD_BODY_POSITION).setInt(BODY_POSITION_SITTING); bloodPressure.getValue(FIELD_BLOOD_PRESSURE_MEASUREMENT_LOCATION) .setInt(BLOOD_PRESSURE_MEASUREMENT_LOCATION_LEFT_UPPER_ARM);
In com.google.body.temperature
, each data point represents a single instantaneous
body temperature measurement.
The data point contains fields for body temperature and the location of the measurement. Specifying the location of measurement is optional.
The body temperature is measured in degrees Celsius.
If specified, the measurement location must have one of the values listed in
FIELD_BODY_TEMPERATURE_MEASUREMENT_LOCATION
.
Sample code for creating a data point with all fields:
DataSource bodyTemperatureDataSource = new DataSource.Builder() .setDataType(TYPE_BODY_TEMPERATURE) ... .build(); DataPoint bodyTemperature = DataPoint.create(bodyTemperatureDataSource); bodyTemperature.setTimestamp(now.getMillis(), MILLISECONDS); bodyTemperature.getValue(FIELD_BODY_TEMPERATURE).setFloat(37.0f); bodyTemperature.getValue(FIELD_BODY_TEMPERATURE_MEASUREMENT_LOCATION) .setInt(BODY_TEMPERATURE_MEASUREMENT_LOCATION_FINGER);
In type com.google.cervical_mucus
data type, each data point represents a user report
of their cervical mucus.
The data point contains fields for cervical mucus texture and amount. Both are optional.
If specified, cervical mucus texture must have one of the values specified in
FIELD_CERVICAL_MUCUS_TEXTURE
.
If specified, cervical mucus amount must have one of the values specified in
FIELD_CERVICAL_MUCUS_AMOUNT
.
Sample code for creating a data point with all fields:
DataSource cervicalMucusDataSource = new DataSource.Builder() .setDataType(TYPE_CERVICAL_MUCUS) ... .build(); DataPoint cervicalMucus = DataPoint.create(cervicalMucusDataSource); cervicalMucus.setTimestamp(now.getMillis(), MILLISECONDS); cervicalMucus.getValue(FIELD_CERVICAL_MUCUS_TEXTURE) .setInt(CERVICAL_MUCUS_TEXTURE_CREAMY) cervicalMucus.getValue(FIELD_CERVICAL_MUCUS_AMOUNT) .setInt(CERVICAL_MUCUS_AMOUNT_MEDIUM);
In the com.google.cervical_position
data type, each data point represents a report
of the user's cervical position.
The data point contains fields for cervical position, dilation and firmness. All fields are optional.
If specified, cervical position must have one of the values listed in
FIELD_CERVICAL_POSITION
.
If specified, cervical dilation must have one of the values listed in
FIELD_CERVICAL_DILATION
.
If specified, cervical firmness must have one of the values listed in
FIELD_CERVICAL_FIRMNESS
.
Sample code for creating a data point with all fields:
DataSource cervicalPositionDataSource = new DataSource.Builder() .setDataType(TYPE_CERVICAL_POSITION) ... .build(); DataPoint cervicalPosition = DataPoint.create(cervicalPositionDataSource); cervicalPosition.setTimestamp(now.getMillis(), MILLISECONDS); cervicalPosition.getValue(FIELD_CERVICAL_POSITION) .setInt(CERVICAL_POSITION_MEDIUM); cervicalPosition.getValue(FIELD_CERVICAL_DILATION) .setInt(CERVICAL_DILATION_MEDIUM); cervicalPosition.getValue(FIELD_CERVICAL_FIRMNESS) .setInt(CERVICAL_FIRMNESS_MEDIUM);
In the com.google.menstruation
data type, each data point represents a report of
the user's menstrual flow.
The data point contains a single field describing the user's menstrual flow, which may have
one of the values listed in FIELD_MENSTRUAL_FLOW
.
Sample code for creating a data point with all fields:
DataSource menstruationDataSource = new DataSource.Builder() .setDataType(TYPE_MENSTRUATION) ... .build(); DataPoint menstruation = DataPoint.create(menstruationDataSource); menstruation.setTimestamp(now.getMillis(), MILLISECONDS); menstruation.getValue(FIELD_MENSTRUAL_FLOW).setInt(MENSTRUAL_FLOW_MEDIUM);
In the com.google.ovulation_test
data type, each data point represents the results
of an ovulation test.
The data point contains a single field,
FIELD_OVULATION_TEST_RESULT
, which indicates the result of the ovulation test. It may be
absent or have one of the values listed in
FIELD_OVULATION_TEST_RESULT
.
Sample code for creating a data point with all fields:
DataSource ovulationTestDataSource = new DataSource.Builder() .setDataType(TYPE_OVULATION_TEST) ... .build(); DataPoint ovulationTest = DataPoint.create(ovulationTestDataSource); ovulationTest.setTimestamp(now.getMillis(), MILLISECONDS); ovulationTest.getValue(FIELD_OVULATION_TEST_RESULT) .setInt(OVULATION_TEST_RESULT_POSITIVE);
In the com.google.oxygen_saturation
data type, each data point represents a single
instantaneous blood oxygen saturation reading.
The data point contains fields for oxygen saturation and details about any supplemental oxygen supplied at the time. All fields except oxygen saturation level and supplemental oxygen flow rate are optional.
Oxygen saturation is measured as a percentage.
Supplemental oxygen flow rate is measured in liters per minute (L/min). It should be set to zero if no supplemental oxygen is being provided.
If specified, oxygen therapy administration mode must have one of the values listed in
FIELD_OXYGEN_THERAPY_ADMINISTRATION_MODE
.
If specified, oxygen saturation system must have one of the values listed in
FIELD_OXYGEN_SATURATION_SYSTEM
.
If specified, oxygen saturation measurement method must have one of the values listed in
FIELD_OXYGEN_SATURATION_MEASUREMENT_METHOD
.
Sample code for creating a data point with all fields:
DataSource oxygenSaturationDataSource = new DataSource.Builder() .setDataType(TYPE_OXYGEN_SATURATION) ... .build(); DataPoint oxygenSaturation = DataPoint.create(oxygenSaturationDataSource); oxygenSaturation.setTimestamp(now.getMillis(), MILLISECONDS); oxygenSaturation.getValue(FIELD_OXYGEN_SATURATION).setFloat(97.0f); oxygenSaturation.getValue(FIELD_SUPPLEMENTAL_OXYGEN_FLOW_RATE).setFloat(3.0f); oxygenSaturation.getValue(FIELD_OXYGEN_THERAPY_ADMINISTRATION_MODE) .setInt(OXYGEN_THERAPY_ADMINISTRATION_MODE_NASAL_CANULA); oxygenSaturation.getValue(FIELD_OXYGEN_SATURATION_SYSTEM) .setInt(OXYGEN_SATURATION_SYSTEM_PERIPHERAL_CAPILLARY); oxygenSaturation.getValue(FIELD_OXYGEN_SATURATION_MEASUREMENT_METHOD) .setInt(OXYGEN_SATURATION_MEASUREMENT_METHOD_PULSE_OXIMETRY);
In com.google.vaginal_spotting
, each data point represents an occurrence of vaginal
spotting.
In data samples, each data point should only have the timestamp set and the number of occurrences should be set to one.
In aggregate, each interval represents one or more occurrences of vaginal spotting, with
the number of occurrences given by FIELD_OCCURRENCES
.
Sample code for creating a data point:
DataSource vaginalSpottingDataSource = new DataSource.Builder() .setDataType(TYPE_VAGINAL_SPOTTING) ... .build(); DataPoint vaginalSpotting = DataPoint.create(vaginalSpottingDataSource); vaginalSpotting.setTimestamp(now.getMillis(), MILLISECONDS); vaginalSpotting.getValue(FIELD_OCCURRENCES).setInt(1);