| java.lang.Object | |
| ↳ | com.google.android.gms.fitness.DataReadRequest.Builder |
Builder used to create new DataReadRequests.
| Public Constructors | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| Public Methods | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
Adds a specific data source we want aggregate data from to this request.
| |||||||||||
Adds the default data source for the given aggregate
dataType to this request. | |||||||||||
Adds a specific data source we want data from to this request.
| |||||||||||
Adds the default data source for the given
dataType to this request. | |||||||||||
Specifies bucket type as
TYPE_ACTIVITY_SEGMENT, sets the minimum duration
of each ACTIVITY_SEGMENT for the bucket. | |||||||||||
Specifies bucket type as
TYPE_ACTIVITY_TYPE, sets the minimum duration of
each ACTIVITY_SEGMENT for computing the buckets. | |||||||||||
Specifies bucket type as
TYPE_SESSION and sets the minimum duration of
each Session for the bucket. | |||||||||||
Specifies bucket type as
TYPE_TIME and sets the duration of each bucket. | |||||||||||
Finishes building and returns the request.
| |||||||||||
Sets the activity data source to be used to extract activity segments for bucketing by
activity type or activity segment.
| |||||||||||
Sets the time range for our query.
| |||||||||||
|
[Expand]
Inherited Methods | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.lang.Object
| |||||||||||
Adds a specific data source we want aggregate data from to this request. Aggregation should be requested in conjunction with one of the bucketing strategy: by time, session or activity. At least one valid detailed data source or aggregate data source should be specified in the request.
| dataSource | the data source we're reading for aggregate data |
|---|
| IllegalStateException | if the data source is already requested as detailed |
|---|---|
| NullPointerException | if the data source is null |
Adds the default data source for the given aggregate dataType to this request.
The default data source is selected based on all available sources for the given data
type, and may be averaged or filtered. Aggregation should be requested in conjunction
with one of the bucketing strategy: by time, session or activity. At least one valid
detailed data source or aggregate data source should be specified in the request
This method can be used instead of addAggregatedDataSource(DataSource)
when the application is not interested in a specific data source.
| dataType | the aggregate data type we're reading |
|---|
| IllegalStateException | if the data type is already requested as detailed |
|---|---|
| NullPointerException | if the data type is null |
Adds a specific data source we want data from to this request. At least one valid detailed data source or aggregate data source should be specified in the request.
| dataSource | the data source we're reading |
|---|
| IllegalArgumentException | if the data source is already requested as aggregate |
|---|---|
| NullPointerException | if the data source is null |
Adds the default data source for the given dataType to this request. The
default data source is selected based on all available sources for the given data
type, and may be averaged or filtered. At least one valid detailed data source or
aggregate data source should be specified in the request.
This method can be used instead of addDataSource(DataSource) when the
application is not interested in a specific data source.
| dataType | the data type we're reading |
|---|
| IllegalStateException | if the data type is already requested as aggregate |
|---|---|
| NullPointerException | if the data type is null |
Specifies bucket type as TYPE_ACTIVITY_SEGMENT, sets the minimum duration
of each ACTIVITY_SEGMENT for the bucket.
An ACTIVITY_SEGMENT represents a continuous time interval with a
single activity value. In this case, each Bucket will represent an individual
activity segment which lies inside the time interval of the request. For instance,
if the user had two separate activity segments for walking, one for 1km and another for
2km, the result will be two buckets one with distance value of 1km and another with
distance value of 2km.
Only activity segments of duration longer than minDuration are chosen for
bucketing.
By default, activity segments are chosen from the default data source. To use a
specific data source, use setActivityDataSource(DataSource).
Detailed data of the aggregate type(s) specified in the request over time interval of
each bucket will be aggregated and returned. Each bucket will have one DataSet
of aggregated data for each requested aggregate DataType.
| IllegalArgumentException | if another bucket type is already specified in the request or if an invalid minDuration is specified |
|---|
Specifies bucket type as TYPE_ACTIVITY_TYPE, sets the minimum duration of
each ACTIVITY_SEGMENT for computing the buckets.
In this case, each Bucket will represent an activity type,
and be comprised of aggregated data over all individual activity segments of this
activity which lie inside the time interval of the request. For instance,
if the user had two separate activity segments of walking during the time interval,
one for a distance of 1km and another for a distance of 2km,
the result will be one activity bucket with a single aggregate data point for distance
with a value of 3km.
Only activity segments of duration longer than minDuration are chosen for
bucketing.
By default, activity segments are chosen from the default data source. To use a
specific data source, use setActivityDataSource(DataSource).
Detailed data of the aggregate type(s) specified in the request over time interval of
each bucket will be aggregated and returned. Each bucket will have one DataSet
of aggregated data for each requested aggregate DataType.
| IllegalArgumentException | if another bucket type is already specified in the request or if an invalid minDuration is specified. |
|---|
Specifies bucket type as TYPE_SESSION and sets the minimum duration of
each Session for the bucket.
A Session represents a time interval with associate meta data to store
user-visible groups of related data. In this case, each bucket will signify a session
which lies inside the time interval of the request.
Detailed data of the aggregate type(s) specified in the request over time interval of
each bucket will be aggregated and returned. Each bucket will have one DataSet
of aggregated data for each requested aggregate DataType..
| IllegalArgumentException | if another bucket type is already specified in the request or if an invalid minDuration is specified |
|---|
Specifies bucket type as TYPE_TIME and sets the duration of each bucket.
The detailed data from the Google Fit store across the time interval of the request is
divided into sub-intervals of length duration, and aggregation is then performed
over each sub-interval to return one Bucket of aggregated data per sub-interval.
Aggregation is performed for data type(s) specified in the request. Each bucket
will have one DataSet of aggregated data per requested aggregate DataType.
| IllegalArgumentException | if another bucket type is already specified in the request or if an invalid duration is specified. |
|---|
Finishes building and returns the request.
| IllegalStateException | if the builder doesn't have enough state to create a valid request |
|---|
Sets the activity data source to be used to extract activity segments for bucketing by
activity type or activity segment. If not set, the default data source for type ACTIVITY_SEGMENT is used.
| IllegalArgumentException | if the specified data source is invalid. |
|---|
Sets the time range for our query. A defined start and end time is required for every read query.
| startTimeMillis | a start time, in milliseconds since epoch, inclusive |
|---|---|
| endTimeMillis | an end time, in milliseconds since epoch, inclusive |