我正在使用Google fit API在Android应用中存储和读取数据。
此请求正在运行:
DataReadRequest readRequest = new DataReadRequest.Builder()
.setTimeRange(startTime, endTime, TimeUnit.MILLISECONDS)
.aggregate(DataType.TYPE_CALORIES_EXPENDED, DataType.AGGREGATE_CALORIES_EXPENDED)
.aggregate(DataType.TYPE_DISTANCE_DELTA, DataType.AGGREGATE_DISTANCE_DELTA)
.aggregate(DataType.TYPE_SPEED, DataType.AGGREGATE_SPEED_SUMMARY)
.aggregate(DataType.TYPE_LOCATION_SAMPLE, DataType.AGGREGATE_LOCATION_BOUNDING_BOX)
.bucketBySession(1, TimeUnit.SECONDS)
.enableServerQueries()
.build();
但我想请求详细的位置点,而不是将它们聚合到一个边界框中:
DataReadRequest readRequest = new DataReadRequest.Builder()
.setTimeRange(startTime, endTime, TimeUnit.MILLISECONDS)
.aggregate(DataType.TYPE_CALORIES_EXPENDED, DataType.AGGREGATE_CALORIES_EXPENDED)
.aggregate(DataType.TYPE_DISTANCE_DELTA, DataType.AGGREGATE_DISTANCE_DELTA)
.aggregate(DataType.TYPE_SPEED, DataType.AGGREGATE_SPEED_SUMMARY)
.read(DataType.TYPE_LOCATION_SAMPLE)
.bucketBySession(1, TimeUnit.SECONDS)
.enableServerQueries()
.build();
此请求应该有效吗?因为我没有获得TYPE_LOCATION_SAMPLE
请求的数据集。