3

I am trying to find the distance the user has runned using the Google Fit SDK. Currently i am using this piece of code

DataReadRequest readRequest =
        new DataReadRequest.Builder().aggregate(DataType.TYPE_DISTANCE_DELTA,
            DataType.AGGREGATE_DISTANCE_DELTA)
            .bucketByTime(1, TimeUnit.DAYS)
            .setTimeRange(mStartTime, mEndTime, TimeUnit.MILLISECONDS)
            .build();

It's working fine except that it returns the distance travelled by the user no matter what way ( by car, airplane, etc...) How do i filter it out to only return data from running activity?

Andy Turner
  • 137,514
  • 11
  • 162
  • 243

0 Answers0