4

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?

pius lee
  • 1,164
  • 1
  • 12
  • 28

1 Answers1

7

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.

gareoke
  • 716
  • 6
  • 17
  • 1
    Perfact explanation! Thank you very much! I already make pedometer with acceleometer in native but I should consider change it webapp with Samsung digital health android sdk. – pius lee Sep 27 '16 at 01:16
  • I can not find a API for gear in http://developer.samsung.com/health it looks java library for android sdk. how can I find some api for gear? – pius lee Sep 27 '16 at 01:31
  • Option 1 is a companion app. Meaning you need an android application as well. Essentially you'd have an android app that uses the Samsung Health SDK and send that information to the Gear using the Samsung Accessory Protocol for communication: http://developer.samsung.com/sample-app/list.do?pi=1&ps=10&pb=Y&ct=CT030000&sc= – gareoke Sep 27 '16 at 06:30
  • In my experience, the native pedometer implementation did not come close to the step count S Health had at the end of the day. – gareoke Sep 27 '16 at 06:32
  • you mean you have to build companion app yourself or you can use S health companion if it is running on your android? – Emil Dec 27 '19 at 03:14