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();
bucketing strategy
.
Apps can request to bucket by 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:
aggregate data type
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 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.
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
.
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 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 the bucket duration for this request in the given time unit.
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 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.
NO_LIMIT
if none
Returns the start time for our query, in the specified time unit