© 2014 Samsung Electronics Co., Ltd. All rightsreserved.
Learning how to retrieve the current motion data is a basic motion management skill:
To get the current motion data, use the getMotionInfo() method:
webapis.motion.getMotionInfo("PEDOMETER", onsuccessCB, onerrorCB);
Use the success and error event handlers to define what to do with the data:
function onsuccessCB(pedometerInfo) { console.log("Step status: " + pedometerInfo.stepStatus); console.log("Cumulative calories: " + pedometerInfo.cumulativeCalorie); console.log("Cumulative distance: " + pedometerInfo.cumulativeDistance); console.log("Cumulative total step count: " + pedometerInfo.cumulativeTotalStepCount); } function onerrorCB(error) { console.log("Error occurs"); }