Languages

Menu
Sites
Language
How to get total accumulative step count without any event?
Out application is for samsung watch gear s3. I already tried following code:
 
function onchangedCB(pedometerInfo) {    
    console.log('accumulativeTotalStepCount: ' + pedometerInfo.accumulativeTotalStepCount);
    tizen.humanactivitymonitor.unsetAccumulativePedometerListener();
}
 
tizen.humanactivitymonitor.setAccumulativePedometerListener(onchangedCB);
 
In this data whatever I am getting is correct, But, in this code onchangedCB func will be called only when there is a change in activity (like Walking, Running) and I want total step count till the time at that movement only, I dont want to wait till next activity happen.
--------------------
I also tried:
tizen.humanactivitymonitor.start("PEDOMETER",
        function onSuccess(pedometerInfo) {
                  console.log(pedometerInfo.cumulativeTotalStepCount)
   });
function onsuccessCB(pedometerInfo) {
     console.log("Accumulative total step count : " + pedometerInfo.accumulativeTotalStepCount);
}
function onerrorCB(error) {
     console.log("Error occurs. name:"+error.name + ", message: "+error.message);
}
tizen.humanactivitymonitor.getHumanActivityData("PEDOMETER", onsuccessCB, onerrorCB);
 
getHumanActivityData is returning data right away but unable to get accumulativeTotalStepCount.
 
Edited by: Sandip Patil on 03 Oct, 2019