gpt4 book ai didi

android - 三星健康 SDK - Android : Read total burnt calories for ideal time

转载 作者:太空狗 更新时间:2023-10-29 14:35:25 28 4
gpt4 key购买 nike

我想从健康应用中获取/读取数据。使用 HealthDataResolver.AggregateRequest 读取不同的数据值,例如总步数和距离。

下面是工作代码,我得到了 startTime 和 endTime 之间的总步数。

HealthDataResolver.AggregateRequest request = new HealthDataResolver.AggregateRequest.Builder()
.setDataType(HealthConstants.StepCount.HEALTH_DATA_TYPE)
.addFunction(HealthDataResolver.AggregateRequest.AggregateFunction.SUM, HealthConstants.StepCount.COUNT, ALIAS_TOTAL_COUNT)
.setTimeGroup(HealthDataResolver.AggregateRequest.TimeGroupUnit.DAILY, 1, HealthConstants.StepCount.START_TIME,
HealthConstants.StepCount.TIME_OFFSET, ALIAS_BINNING_TIME)
.setLocalTimeRange(HealthConstants.StepCount.START_TIME, HealthConstants.StepCount.TIME_OFFSET,
startTime, endTime)
.setSort(ALIAS_BINNING_TIME, HealthDataResolver.SortOrder.ASC)
.build();

现在的问题是我想通过理想的时间/Activity 获得距离和燃烧的卡路里。任何锻炼或步数都不会燃烧任何卡路里。参见 this screenshot应用程序的所需数据已加框并带有下划线。

那么要读取理想时间/Activity 消耗的距离和卡路里,如何构造 AggregateRequest ?或者是否有任何计算?

帮助将不胜感激。

最佳答案

来自 wiki

The metabolic equivalent of task (MET) is the objective measure of theratio of the rate at which a person expends energy, relative to themass of that person, while performing some specific physical activitycompared to a reference, set by convention at 3.5 ml of oxygen perkilogram per minute, which is roughly equivalent to the energyexpended when sitting quietly.

您可以使用其中一个 Metabolic Rate Formulas

The Revised Harris-Benedict Equation

Men BMR = 88.362 + (13.397 x weight in kg) + (4.799 x height in cm) -(5.677 x age in years)

Women BMR = 447.593 + (9.247 x weight in kg) +(3.098 x height in cm) - (4.330 x age in years)

关于android - 三星健康 SDK - Android : Read total burnt calories for ideal time,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57038163/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com