Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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?

like image 477
pius lee Avatar asked Mar 11 '23 01:03

pius lee


1 Answers

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.

like image 78
gareoke Avatar answered May 16 '23 07:05

gareoke