LocalDataReadResponse

public class LocalDataReadResponse extends Response<DataReadResult>

Result of LocalRecordingClient.readData(com.google.android.gms.fitness.request.LocalDataReadRequest).

Contains exactly one data set for each detailed data type requested in the LocalDataReadRequest.

The method getDataSet(LocalDataType) can be used to fetch the resulting detailed data for a specific data type.

If aggregate data was requested, then the result will return buckets created as per the bucketing strategy specified in the request. Each bucket will have one data set per aggregate data requested.

The method getBuckets() can be used to retrieve the buckets.

The method getStatus() can be be used to confirm if the request was successful.

Public Method Summary

List<LocalBucket>
getBuckets()
Returns all of the Buckets with aggregated data.
LocalDataSet
getDataSet(LocalDataType dataType)
Returns the resulting data set for the given LocalDataType.
List<LocalDataSet>
getDataSets()
Returns all of the data sets in the result.
Status

Inherited Method Summary

Public Methods

public List<LocalBucket> getBuckets ()

Returns all of the Buckets with aggregated data. In each bucket, there will be exactly one data set for each aggregated data type requested in the LocalDataReadRequest.

Buckets only contain aggregated data requested via LocalDataReadRequest.Builder.aggregate(LocalDataType). Non-aggregated data can be accessed via getDataSet(LocalDataType).

Returns
  • An empty list if the read request failed.

public LocalDataSet getDataSet (LocalDataType dataType)

Returns the resulting data set for the given LocalDataType.

This method returns only non-aggregated data sets that were queried via LocalDataReadRequest.Builder.read(LocalDataType). Aggregated data can be queried via getBuckets().

Returns
  • A data set for the given data type, empty if no data was found.

public List<LocalDataSet> getDataSets ()

Returns all of the data sets in the result. There will be exactly one data set for each data type requested in the LocalDataReadRequest.

This method returns only non-aggregated data sets that were queried via LocalDataReadRequest.Builder.read(LocalDataType). Aggregated data can be queried via getBuckets().

public Status getStatus ()