GearS2 S Health step count

GearS2 S Health step count

BY 22 Feb 2016 Web Application Development

Hello!

I am trying to get steps count on Samsung Gear S2 for my Gear App.
And could not find the way how to get step count same as in S Health.
I have read all Tizen documents for Gear. Tried all methods, but nothing.
 
I have read that I should use stepCountDifferences for it.
 
I have used all methods, and read stepCountDifferences in all of them, and every there it only 1 element in the array ( looks like with difference between current and last data)

function onPedometerUpdate(pedometerData) {
  var d = pedometerData.stepCountDifferences[0];
  barmsg = pedometerData.stepCountDifferences.length +’:’+ d.stepCountDifference +’:’+ d.timestamp; // 1:1:1455707460
}

tizen.humanactivitymonitor.setAccumulativePedometerListener(onPedometerUpdate);

tizen.humanactivitymonitor.start(‘PEDOMETER’, onPedometerUpdate);

tizen.humanactivitymonitor.getHumanActivityData(‘PEDOMETER’, onPedometerUpdate, null); 
 

Looks like I’m use this attribute stepCountDifferences in wrong way. I very much ask you to tell how to use it in correct way.

 
Thank you.
Written by