ReadRecordsRequest

class ReadRecordsRequest<T : 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 : Record>

type of Record, such as Steps.

Summary

Public constructors

<T : Record> ReadRecordsRequest(
    recordType: KClass<T>,
    timeRangeFilter: TimeRangeFilter,
    dataOriginFilter: Set<DataOrigin>,
    ascendingOrder: Boolean,
    pageSize: Int,
    pageToken: String?
)

Public functions

open operator Boolean
equals(other: Any?)
open Int

Public constructors

ReadRecordsRequest

<T : Record> ReadRecordsRequest(
    recordType: KClass<T>,
    timeRangeFilter: TimeRangeFilter,
    dataOriginFilter: Set<DataOrigin> = emptySet(),
    ascendingOrder: Boolean = true,
    pageSize: Int = 1000,
    pageToken: String? = null
)
Parameters
<T : Record>

type of Record, such as Steps.

recordType: KClass<T>

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

timeRangeFilter: TimeRangeFilter

The TimeRangeFilter to read from.

dataOriginFilter: Set<DataOrigin> = emptySet()

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

ascendingOrder: Boolean = true

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

pageSize: Int = 1000

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.

pageToken: String? = null

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 functions

equals

open operator fun equals(other: Any?): Boolean

hashCode

open fun hashCode(): Int