How to get Pedometer Step Count data Same as SHealth in Gear s2 (Tizen 2.3.2)?

老子叫甜甜 提交于 2019-12-12 18:36:08

问题


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?


回答1:


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.



来源:https://stackoverflow.com/questions/39652983/how-to-get-pedometer-step-count-data-same-as-shealth-in-gear-s2-tizen-2-3-2

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