How to get Pedometer Step Count data Same as SHeal

2019-07-09 03:58发布

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条回答
淡お忘
2楼-- · 2019-07-09 04:15

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.

查看更多
登录 后发表回答