ReadRecordsRequest

public final class ReadRecordsRequest<T extends Record>


Request object to read Records in Android Health Platform determined by time range and other filters.

Returned collection will contain a androidx.health.data.client.response.ReadRecordsResponse.pageToken if number of records exceeds pageSize. Use this if you expect an unbound number of records within specified time ranges. Stops at any time once desired amount of records are processed.

Parameters
<T extends Record>

type of Record, such as Steps.

Summary

Public constructors

<T extends Record> ReadRecordsRequest(
    @NonNull KClass<@NonNull T> recordType,
    @NonNull TimeRangeFilter timeRangeFilter,
    @NonNull Set<@NonNull DataOrigin> dataOriginFilter,
    boolean ascendingOrder,
    int pageSize,
    String pageToken
)

Public methods

boolean
equals(Object other)
int

Public constructors

ReadRecordsRequest

public <T extends Record> ReadRecordsRequest(
    @NonNull KClass<@NonNull T> recordType,
    @NonNull TimeRangeFilter timeRangeFilter,
    @NonNull Set<@NonNull DataOrigin> dataOriginFilter,
    boolean ascendingOrder,
    int pageSize,
    String pageToken
)
Parameters
<T extends Record>

type of Record, such as Steps.

@NonNull KClass<@NonNull T> recordType

Which type of Record to read, such as Steps::class.

@NonNull TimeRangeFilter timeRangeFilter

The TimeRangeFilter to read from.

@NonNull Set<@NonNull DataOrigin> dataOriginFilter

List of DataOrigin to read from, or empty for no filter.

boolean ascendingOrder

Whether the Record should be returned in ascending or descending order by time. Default is true for ascending.

int pageSize

Maximum number of Record within one page. If there's more data remaining (and the next page should be read), the response will contain a pageToken to be used in the subsequent read request. Must be positive, default to 1000.

String pageToken

Continuation token to access the next page, returned in the response to the previous page read request, or null for the initial request for the first page.

Public methods

equals

public boolean equals(Object other)

hashCode

public int hashCode()