Getting steps for fitness?

I work with the Google Fit SDK, I can easily get detailed information about the steps, but I'm really struggling to make sure what actions were performed during these steps.

DataSource ESTIMATED_STEP_DELTAS = new DataSource.Builder() .setDataType(DataType.TYPE_STEP_COUNT_DELTA) .setType(DataSource.TYPE_DERIVED) .setStreamName("estimated_steps") .setAppPackageName("com.google.android.gms") .build(); DataReadRequest readRequest = new DataReadRequest.Builder() .aggregate(ESTIMATED_STEP_DELTAS, DataType.AGGREGATE_STEP_COUNT_DELTA) .bucketByTime(1, TimeUnit.HOURS) .setTimeRange(startTime, endTime, TimeUnit.MILLISECONDS) .build(); 

In response, if I check the DataSet, its always com.google.step_count.delta strong>.

I want something like this

+5
source share
1 answer

I think you should use bucketByActivityType instead of bucketByTime.

Then, in the dataset of the resulting Bucket, use getActivity () to get the type of activity.

0
source

All Articles