Track real-time step counts, distance walked, and elevation floor climbs using native device motion coprocessors.
Track real-time step counts and physical activity with Pedometer Step Tracker. Nativine embeds native CoreMotion (iOS) and Android Step Counter sensors, enabling fitness, health, and gamified walk-tracking web applications.
Tracking physical movement requires low-power hardware sensor access. Nativine's native Pedometer plugin queries hardware motion coprocessors (Apple M-series coprocessor / Android Sensor.TYPE_STEP_COUNTER):
To query step counts or subscribe to live pedometer updates in JavaScript, call nativine.pedometer.startUpdates():
// Query historical steps for today
nativine.pedometer.querySteps({
startDate: new Date().setHours(0,0,0,0),
endDate: new Date().getTime(),
callback: 'onStepDataReceived'
});
function onStepDataReceived(data) {
console.log("Steps Taken Today:", data.numberOfSteps);
console.log("Distance Walked (m):", data.distance);
console.log("Floors Ascended:", data.floorsAscended);
}
| Parameter | Type | Description |
|---|---|---|
startDate | timestamp | Required. Start Unix timestamp (milliseconds). |
endDate | timestamp | Required. End Unix timestamp (milliseconds). |
No. Step tracking uses low-power dedicated hardware motion coprocessors, using negligible battery power.
Yes. iOS requires user consent for Motion & Fitness access when first initializing pedometer queries.