google fit sdk running distance

天涯浪子 提交于 2019-12-23 21:50:28

问题


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?

来源:https://stackoverflow.com/questions/28904226/google-fit-sdk-running-distance

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!