java.lang.Object | |
↳ | com.google.android.gms.fitness.request.DataReadRequest |
Request for reading data from Google Fit. Use this request to specify the data types to read, as well as aggregation parameters. Read requests require a time range and allow reading data in detailed or aggregated fashion. A single request can be used to read multiple data types and data sources together.
new DataReadRequest.Builder() .setTimeRange(startTime.getMillis(), endTime.getMillis(). TimeUnit.MILLISECONDS) .read(DataTypes.LOCATION_SAMPLE) .build();
time
,
activity type
,
activity segment
, or session
.
Apps should also specify at least one input data source or data type to aggregate. See
AGGREGATE_INPUT_TYPES
for a list of valid input data types supported for aggregation.
The aggregation request should specify:
Example usage for selecting location bounding boxes for each hour:
new DataReadRequest.Builder() .setTimeRange(startTime.getMillis(), endTime.getMillis(), TimeUnit.MILLISECONDS) .bucketByTime(1, TimeUnit.HOURS) .aggregate(DataTypes.LOCATION_SAMPLE, AggregateDataTypes.LOCATION_BOUNDING_BOX) .build();
Nested Classes | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
DataReadRequest.Builder | Builder used to create new DataReadRequests. |
Constants | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
int | NO_LIMIT | Constant specifying no limit has been set. |
[Expand]
Inherited Constants | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
![]() |
Fields | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
CREATOR |
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Returns the data source used to get activity segments for creating buckets for
data aggregation in this request.
| |||||||||||
Returns all of the data sources that will be read then aggregated as part of this request.
| |||||||||||
Returns all of the data types that will be read then aggregated as part of this request.
| |||||||||||
Returns the bucket duration for this request in the given time unit.
| |||||||||||
Returns the bucket type for data aggregation for this request.
| |||||||||||
Returns the data sources that should 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 specified time unit
| |||||||||||
Returns the list of data quality standards which will restrict the data sources used in
this query.
| |||||||||||
Returns the max number of data points to return in the result.
| |||||||||||
Returns the start time for our query, in the specified time unit
| |||||||||||
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
![]() | |||||||||||
![]() |
Constant specifying no limit has been set.
Parameters | |
---|---|
that |
Object
|
Returns | |
---|---|
boolean |
Returns the data source used to get activity segments for creating buckets for data aggregation in this request.
This data source is used when bucketing by activity segment or activity type.
Returns | |
---|---|
DataSource |
the data source, or null if unset
|
Returns all of the data sources that will be read then aggregated as part of this request.
Each data source will be read then aggregated as specified in
aggregate(DataSource, DataType)
.
Returns | |
---|---|
List<DataSource> |
the input data sources for aggregation, empty if none |
Returns all of the data types that will be read then aggregated as part of this request.
The default data source for each data type will be read, then aggregated as specified in
aggregate(DataType, DataType)
.
Returns | |
---|---|
List<DataType> |
the input data types for aggregation, empty if none |
Returns the bucket duration for this request in the given time unit.
Parameters | |
---|---|
timeUnit |
TimeUnit
|
Returns | |
---|---|
long |
Returns the bucket type for data aggregation for this request.
Returns | |
---|---|
int |
Returns the data sources that should be read in this request.
Returns | |
---|---|
List<DataSource> |
all specified data sources, empty if none |
Returns the data types for which default data sources should be read in this request.
Returns | |
---|---|
List<DataType> |
all specified data types, empty if none |
Returns the end time for our query, in the specified time unit
Parameters | |
---|---|
timeUnit |
TimeUnit
|
Returns | |
---|---|
long |
Returns the list of data quality standards which will restrict the data sources used in this query. If the list is empty all data sources will be included.
Returns | |
---|---|
List<Integer> |
Returns the max number of data points to return in the result. If specified, only the latest data points up to the given limit will be read.
Returns | |
---|---|
int |
the query limit, or NO_LIMIT if none
|
Returns the start time for our query, in the specified time unit
Parameters | |
---|---|
timeUnit |
TimeUnit
|
Returns | |
---|---|
long |
Returns | |
---|---|
int |
Returns | |
---|---|
String |
Parameters | |
---|---|
dest |
Parcel
|
flags |
int
|