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()) .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
INPUT_TYPES
for a list of valid input data types supported for aggregation.
The aggregation request should specify:
aggregate data types
Example usage for selecting location bounding boxes for each hour:
new DataReadRequest.Builder() .setTimeRange(startTime.getMillis(), endTime.getMillis()) .bucketByTime(1, TimeUnit.HOURS) .aggregate(DataTypes.LOCATION_SAMPLE, AggregateDataTypes.LOCATION_BOUNDING_BOX) .build();
Nested Classes | |||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
DataReadRequest.Builder | Builder used to create new DataReadRequests. |
[Expand]
Inherited Constants | |||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
![]()
| |||||||||||||||||
![]()
|
Fields | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
CREATOR |
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
[Expand]
Inherited Methods | |||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
![]() | |||||||||||||||||||||||||||||||||
![]() |