3

支持目标打卡,活力三环让运动更有趣 - HMSCore技术团队

 1 year ago
source link: https://www.cnblogs.com/hmscore/p/17526056.html
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

1 .什么是活力三环

熟悉华为运动健康、华为智能穿戴的小伙伴们一定对“健康三环”有所了解。

在最新版本的华为运动健康App以及HUAWEI WATCH 4 系列产品中,全新推出了“活力三环”,助力用户养成运动习惯,保持活力满满。

up-ef168e389e1386756cc9cdcd4967782e377.png

全新的“活力三环”,支持制定每日目标,打卡三环任务——活动热量、锻炼时长、活动小时数。

up-a4ce4f5cb81e180b5e286955e2957b61454.png

活动热量:因活动产生的卡路里消耗,您可以通过跑步、骑行或者做家务、遛狗等日常活动消耗活动热量。

锻炼时长:中高强度锻炼时间的总和。尝试进行快走、慢跑等中高强度运动,适度参加力量训练,能够提升心肺耐力和力量水平,全面提升身体素质。

活动小时数:每小时是否站立活动的记录。假设您在某个小时里面(例如 10:00-11:00)走路超过 1min,那么这个小时属于活动小时,活动小时数在此期间会增加1。久坐对身体健康有害,建议您白天期间每个小时内都起身活动一次,全天在早上 7:00-晚上10:00之间,达成每天活动小时数>=12 的目标。

2. 日常活动统计数据开放

2.1 功能简介

华为运动健康服务在6.11.0版本中开放了日常活动统计数据开放,将活力三环数据与步数数据通过日常活动统计数据查询接口开放给生态应用,便于生态应用获取用户的日常活动情况,以及活动目标达成情况。

2.2 日常活动统计数据查询接口

该接口提供了用户的日常活动统计数据以天为单位的查询功能。

说明:华为运动健康App版本号13.1.4.300及以上版本支持。

接口URL:https://health-api.cloud.huawei.com/healthkit/v2/sampleSet:dailyActivitySummary

请求示例:

POST
https://health-api.cloud.huawei.com/healthkit/v2/sampleSet:dailyActivitySummary
Content-Type: application/json
Authorization: Bearer ***
x-client-id: ***
x-version: ***
x-caller-trace-id: ***
{
 "startDay": "20230312",
 "endDay": "20230312",
 "timeZone": "+0800"
}

响应示例:

HTTP/1.1 200 OK
Content-type: application/json;charset=utf-8
x-health-app-privacy: 1
{
    "startTime": 1678550400000,
    "endTime": 1678809599999,
    "timeZone": "+0800",
    "dailyActivitySummary": [
        {
            "startTime": 1678550400000000000,
            "endTime": 1678636799999000000,
            "dataTypeName": "com.huawei.daily_activity_summary",
            "originalDataCollectorId": "cmF3OmRhaWx5X2FjdGl2aXR5X3N1bW1hcnk6Y29tLmh1YXdlaS5oZWFsdGg6wvoX9uVJBQbaymBFLmI6GhXLqvSSQAF044F4y8IAYWU",
            "value": [
                {
                    "fieldName": "steps",
                    "integerValue": 5039
                },
                {
                    "fieldName": "stepsGoal",
                    "integerValue": 10000
                },
                {
                    "fieldName": "activeHours",
                    "integerValue": 8
                },
                {
                    "fieldName": "activeHoursGoal",
                    "integerValue": 12
                },
                {
                    "fieldName": "exerciseTime",
                    "integerValue": 35
                },
                {
                    "fieldName": "exerciseTimeGoal",
                    "integerValue": 20
                },
                {
                    "fieldName": "activeCalories",
                    "integerValue": 120
                },
                {
                    "fieldName": "activeCaloriesGoal",
                    "integerValue": 230
                }
            ]
        }
    ]
}

数据类型字段列表请参见日常活动统计原子采样数据章节。

完整的接口参数说明请参见日常活动统计数据查询章节。

了解更多详情>>

访问运动健康服务解决方案

获取运动健康服务开发指导文档

访问HMS Core 联盟官网

获取HMS Core 开发指导文档

关注我们,第一时间了解 HMS Core 最新技术资讯~


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK