java.lang.Object | |
↳ | com.google.android.gms.fitness.request.SessionReadRequest.Builder |
Builder used to create a new SessionReadRequest.
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Finishes building and returns the request.
| |||||||||||
Enable querying the Google Fit server to fetch query results,
in case the local store doesn't have data for the full requested time range.
| |||||||||||
Exclude sessions from a particular package name from the read result.
| |||||||||||
Reads data from the default data source of the given
dataType for each
session selected by this request.
| |||||||||||
Reads data from a given
dataSource for each session selected by this request.
| |||||||||||
Enables reading sessions inserted by any app.
| |||||||||||
Adds an optional session identifier to this request.
| |||||||||||
Adds an optional session name to this request.
| |||||||||||
Sets the time range for the sessions we want to select in our query,
in a specific
TimeUnit .
|
[Expand]
Inherited Methods | |||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
![]() |
Finishes building and returns the request.
IllegalArgumentException | if the builder doesn't have valid time interval data to create a read request |
---|---|
IllegalStateException | if the builder doesn't have valid data type or data source to create a read request |
Enable querying the Google Fit server to fetch query results, in case the local store doesn't have data for the full requested time range. Server results will be combined with local results.
Note that querying the server adds latency, specially under poor network conditions. Also note that attempting to query the server when there is no network connection may result in atransient error
.
Server queries are off by default.
Exclude sessions from a particular package name from the read result. This method
can be used in combination with readSessionsFromAllApps()
to exclude sessions
from apps that are not of interest (for instance, sessions you have written yourself).
Reads data from the default data source of the given dataType
for each
session selected by this request. The default data source may be aggregated or merged.
The read data will be returned as a separate
DataSet
for each returned session.
dataType | the data type we are reading |
---|
Reads data from a given dataSource
for each session selected by this request.
The read data will be returned as a separate
DataSet
for each returned session.
dataSource | the data source we're reading |
---|
Enables reading sessions inserted by any app. If not set, only sessions added by the calling app will be returned.
Adds an optional session identifier to this request. If specified, only the session with the exact identifier is selected.
Only one session identifier can be specified per request. Calling this method multiple times will override the previous call.sessionId | the ID of the session we want data for |
---|
Adds an optional session name to this request. If specified, only sessions with the exact name are selected.
Only one session name can be specified per request. Calling this method multiple times will override the previous call.sessionName | the name of the session we want data for |
---|
Sets the time range for the sessions we want to select in our query,
in a specific TimeUnit
.
name
and
identifier
can be used to further restrict the
returned sessions.
For a session to be returned, it has to fall completely within the interval
specified in the query. Overlapping sessions with start and/or end times outside the
interval will not be returned. Ongoing sessions (with no end time specified yet)
whose start time falls within the interval are returned.startTime | a start time since epoch, inclusive |
---|---|
endTime | an end time since epoch, inclusive |
timeUnit | time unit for the start and end times |