AggregateRequest

Represents a request for an aggregation query over a period of time after running aggregate operations, such as TOTAL, LAST, and so on for HealthDataPoint.

An available aggregation operation is different for each data type. See a data type's member properties with AggregateOperation. For example, NutritionType has TOTAL_CALORIES.

This request can include filters, such as the source filter and time filter. For example, if both of the following conditions have been applied for an aggregate request:

then the SDK checks for all data with the specified time that has been generated by the Samsung Health app.

This is a sample code for retrieving aggregated data, in this case retrieving the total count of real steps:

suspend fun readStepsData() {
     val healthDataStore = HealthDataService.getStore(context)
     val readRequest = DataType.StepsType.TOTAL.requestBuilder
         // set some filters or conditions
         .build()

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

Since

1.0.0

Types

Link copied to clipboard

A local date time builder for all data sources to create an AggregateRequest instance.

Link copied to clipboard
interface Builder<T : Any>

The interface of the builder for making an AggregateRequest.

Link copied to clipboard

A dual time builder to create an AggregateRequest instance.

Link copied to clipboard

A local date builder to create an AggregateRequest instance.

Link copied to clipboard

A local time builder to create an AggregateRequest instance.

Properties

Link copied to clipboard

The data type of this request.

Link copied to clipboard

The InstantTimeFilter of this request.

Link copied to clipboard

The InstantTimeGroup of this request.

Link copied to clipboard

The LocalTimeFilter of this request.

Link copied to clipboard

The LocalTimeGroup of this request.

Link copied to clipboard

The ordering of this request.

Link copied to clipboard

The page size of this request, which means the size of the data in one results page.

Link copied to clipboard

The page token of this request.

Link copied to clipboard

The AggregateSourceFilter of this request.

Link copied to clipboard

This is the target AggregateOperation.

Preferences Submitted

You have successfully updated your cookie preferences.