readDataAsync

Reads a set of the Samsung Health app's data according to the specified request.

This method returns the original data point that is not processed or aggregated. The following code shows how to use readDataAsync function to retrieve a list of heart rate values from a specific period of time:

val readRequest = DataTypes.HEART_RATE.readDataRequestBuilder
    .setLocalTimeFilter(localTimeFilter)
    .build()
val result = healthDataStore.readDataAsync(readRequest).get().dataList
result.forEach { heartRateDataPoint->
    val hr = heartRateDataPoint.getValue(DataType.HeartRateType.HEART_RATE)?.heartRate
    // This processes the heart rate value.
}

Return

The AsyncSingleFuture instance that returns the specified DataPoint data set.

Since

1.0.0

Parameters

request

A ReadDataRequest instance to specify the read conditions.

Preferences Submitted

You have successfully updated your cookie preferences.