如何获取计步器步数数据与 Gear s2 (Tizen 2.3.2) 中的 SHealth 相同? [英] How to get Pedometer Step Count data Same as SHealth in Gear s2 (Tizen 2.3.2)?

查看:34
本文介绍了如何获取计步器步数数据与 Gear s2 (Tizen 2.3.2) 中的 SHealth 相同?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经知道 tizen 计步器每天的步数可以从tizen.humanactivitymonitor"获得,以防万一.

但我无法在真正的 Gear s2 设备上的网络应用程序中获取它.

我也尝试使用原生系统传感器 API.但是我在 Tizen Native API 中找不到计步器 API.

如何在 Native 端和 Web 端获取步数?

解决方案

使用 Tizen Wearable SDK 2.3.2,无法读取 S Health 步数数据.这些是您的选择:

  1. WebAPI + 三星数字健康 Android SDK:这是读取当天 S 健康步数的唯一方法.他们还提供样品:http://developer.samsung.com/health

  2. WebAPI 独立(没有配套应用程序):虽然这种方法不会一直匹配 S Health 步数数据,但它可以让您获得相对接近的当天步数.例如,如果您重置应用程序并需要恢复您之前拥有的步数,则 stepOffset 将是.例如,这可以从保存到磁盘或 SQLite 的平面文件中读取.从本质上讲,您必须在一天开始时执行 .start,由警报触发或检查最后日期是否为 != 当前日期:

<块引用>

tizen.humanactivitymonitor.start(计步器",函数(计步器信息){document.getElementById("stepValue").innerHTML = pedometerInfo.cumulativeTotalStepCount + stepOffset;}, onError);

  1. 原生API:使用加速度计开发您自己的计步器(不推荐)

  2. 仅用于显示:http://developer.samsung.com/gear/design/watch-designer.watch-designer 实用程序允许您拖放某些 UI 元素,其中之一是步数.但是,您无法读取此数据,因为这会生成不可读的本机代码.

I know already tizen pedometer step count of day can get from "tizen.humanactivitymonitor" in case of web application.

but I fail to get it in web app on real gear s2 device.

And also I try it with Native System sensor API. but I can not found the Pedometer API in Tizen Native API.

How can I get Step Count of Day in both of Native and Web side?

解决方案

Using the Tizen Wearable SDK 2.3.2, there is no way to read the S Health step count data. These are your options:

  1. WebAPI + Samsung Digital Health Android SDK: This is the only way to read S Health step count for the day. They provide samples as well: http://developer.samsung.com/health

  2. WebAPI standalone (without a companion app): Although this approach will not match S Health step data all the time, it will allow you to get the step count for the day relatively close. The stepOffset would be if you reset the app for example and needed to recover the step count you previously had. This would be done reading from a flat file from you save to disk or SQLite for example. Essentially, you would have to do a .start at the beginning of the day, triggered by an alarm or checking if the last date != current date:

tizen.humanactivitymonitor.start("PEDOMETER", function(pedometerInfo){
          document.getElementById("stepValue").innerHTML = pedometerInfo.cumulativeTotalStepCount + stepOffset;
      }, onError);

  1. NativeAPI: Develop your own Pedometer using the accelerometer (not recommended)

  2. For Display Only: http://developer.samsung.com/gear/design/watch-designer. The watch-designer utility allows you to drag and drop certain UI elements one of them being step count. However, you cannot read this data as this produces unreadable native code.

这篇关于如何获取计步器步数数据与 Gear s2 (Tizen 2.3.2) 中的 SHealth 相同?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆