java.lang.Object | |
↳ | com.google.android.gms.fitness.request.SessionReadRequest |
Request for reading Session
data from Google Fit. Use
this request to specify the sessions to read, as well as data sets that should be read for each session.
Example usage for reading all sessions during a time interval, as well as location data points for each session:
new SessionReadRequest.Builder() .setTimeInterval(startTime.getMillis(), endTime.getMillis(), TimeUnit.MILLISECONDS) .read(DataTypes.LOCATION_SAMPLE) .build();
A valid time interval is mandatory for the request. Session name and identifier are optional fields that can be used to further filter out the returned result.
By default, only sessions created by the calling app will be returned. To get sessions created
by other apps, use readSessionsFromAllApps()
}
An app can only read public data types or custom data created by itself. Custom data types created by another app cannot be read.
Nested Classes | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
SessionReadRequest.Builder | Builder used to create a new SessionReadRequest. |
[Expand]
Inherited Constants | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
![]() |
Fields | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
CREATOR |
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Returns the data sources to be read in this request.
| |||||||||||
Returns the data types for which default data sources should be read in this request.
| |||||||||||
Returns the end time for our query, in the given time unit
| |||||||||||
Returns any app package names that were excluded from the request.
| |||||||||||
Returns the session id we are requesting data for.
| |||||||||||
Returns the session name we are requesting data for.
| |||||||||||
Returns the start time for our query, in the given time unit
| |||||||||||
Returns true if the read data should include sessions from other apps.
| |||||||||||
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
![]() | |||||||||||
![]() |
Parameters | |
---|---|
o |
Object |
Returns | |
---|---|
boolean |
Returns the data sources to be read in this request.
Returns | |
---|---|
List<DataSource> |
the specified data sources, empty if none |
Returns the data types for which default data sources should be read in this request.
Returns | |
---|---|
List<DataType> |
the specified data types, empty if none |
Returns the end time for our query, in the given time unit
Parameters | |
---|---|
timeUnit |
TimeUnit |
Returns | |
---|---|
long |
Returns any app package names that were excluded from the request.
Returns | |
---|---|
List<String> |
the list of excluded packages, empty if none |
Returns the session id we are requesting data for.
Returns | |
---|---|
String |
the specified session identifier, or null if unspecified
|
Returns the session name we are requesting data for.
Returns | |
---|---|
String |
the specified session name, or null if unspecified
|
Returns the start time for our query, in the given time unit
Parameters | |
---|---|
timeUnit |
TimeUnit |
Returns | |
---|---|
long |
Returns | |
---|---|
int |
Returns true if the read data should include sessions from other apps.
Returns | |
---|---|
boolean |
Returns | |
---|---|
String |
Parameters | |
---|---|
dest |
Parcel |
flags |
int |