簡體   English   中英

獲取有關健身活動的步驟詳情?

[英]Getting Steps details with respect to fitness activities?

我正在使用Google Fit SDK,我可以輕松獲取步驟詳細信息但我真的很難在執行這些步驟時完成哪些活動。

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();

作為回應,如果我檢查DataSet源它總是com.google.step_count.delta

我想要這樣的東西

我認為你應該使用bucketByActivityType而不是bucketByTime。

然后,在生成的Bucket的數據集上,使用getActivity()獲取活動類型。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM