Write Blood Pressure Data

Your app can record blood pressure data by writing to the com.google.blood_pressure data type. In this 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 during the reading, and location on the body where the measurement was performed.

To write a blood pressure data point, create a new DataSource of TYPE_BLOOD_PRESSURE, as shown in the following example.

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);

Send feedback about...