ReadDataRequest

Represents a request for a read query over a period of time to get a list of original HealthDataPoints.

The fields vary for each data type. They are listed within each data type as various fields. For example, NutritionType has MEAL_TYPE, CALORIES and so on.

The request can include filters such as ID filter, source filter, and time filter. In case of IdFilter, it is possible to set one or more data uids.

For example, if both of the following conditions have been applied for a reading data request:

the SDK checks all data for each specified uid and the data's source device being a watch.

This is the sample code for reading heart rate data:

suspend fun readHeartRateData() {
     val healthDataStore = HealthDataService.getStore(context)
     val readRequest = DataTypes.HEART_RATE.readDataRequestBuilder
         // set some filters or conditions
         .build()

     // make asynchronous call for result
     val result = healthDataStore.readData(readRequest)
     // process data
}

Since

1.0.0

Types

Link copied to clipboard
interface Builder<T : DataPoint>

The interface of the builder for making a ReadDataRequest.

Link copied to clipboard

A dual time builder to set the fields and create a ReadDataRequest instance.

Link copied to clipboard

A local date builder to create a ReadDataRequest instance.

Link copied to clipboard

Properties

Link copied to clipboard

The data type of this request.

Link copied to clipboard

The IdFilter of this request.

Link copied to clipboard

The InstantTimeFilter of this request.

Link copied to clipboard
val limit: Int?

The limit of this request indicating the maximum size of result data.

Link copied to clipboard

The LocalTimeFilter of this request.

Link copied to clipboard

The ordering of this request.

Link copied to clipboard

The page size of this request indicating the size of data in one result page.

Link copied to clipboard

The page token of this request.

Link copied to clipboard

The ReadSourceFilter of this request.

Preferences Submitted

You have successfully updated your cookie preferences.