Accurate Step Counter Integration for iOS and Android

Reliable Step Counter Implementation in Mobile Apps We integrate accurate step counters into your mobile app, leveraging system hardware for 98% accuracy and minimal battery drain. With over 10 years of experience and 50+ fitness app projects, we ensure no duplicate data across HealthKit and Heal

Development and support of all types of mobile applications:

Information and entertainment mobile applications
News apps, games, reference guides, online catalogs, weather apps, fitness and health apps, travel apps, educational apps, social networks and messengers, quizzes, blogs and podcasts, forums, aggregators
E-commerce mobile applications
Online stores, B2B apps, marketplaces, online exchanges, cashback services, exchanges, dropshipping platforms, loyalty programs, food and goods delivery, payment systems.
Business process management mobile applications
CRM systems, ERP systems, project management, sales team tools, financial management, production management, logistics and delivery management, HR management, data monitoring systems
Electronic services mobile applications
Classified ads platforms, online schools, online cinemas, electronic service platforms, cashback platforms, video hosting, thematic portals, online booking and scheduling platforms, online trading platforms

These are just some of the types of mobile applications we work with, and each of them may have its own specific features and functionality, tailored to the specific needs and goals of the client.

Showing 1 of 1All 1734 services
Accurate Step Counter Integration for iOS and Android
Medium
from 1 day to 3 days

Our competencies:

Frequently Asked Questions

Latest works

  • image_mobile-applications_feedme_467_0.webp
    Development of a mobile application for FEEDME
    895
  • image_mobile-applications_xoomer_471_0.webp
    Development of a mobile application for XOOMER
    782
  • image_mobile-applications_rhl_428_0.webp
    Development of a mobile application for RHL
    1216
  • image_mobile-applications_zippy_411_0.webp
    Development of a mobile application for ZIPPY
    1079
  • image_mobile-applications_affhome_429_0.webp
    Development of a mobile application for Affhome
    1002
  • image_mobile-applications_flavors_409_0.webp
    Development of a mobile application for the FLAVORS company
    597

Reliable Step Counter Implementation in Mobile Apps

We integrate accurate step counters into your mobile app, leveraging system hardware for 98% accuracy and minimal battery drain. With over 10 years of experience and 50+ fitness app projects, we ensure no duplicate data across HealthKit and Health Connect. A phone in a pocket produces different accelerometer patterns than one in a hand, and double-counting data between HealthKit and Health Connect is one of the most common complaints in reviews. We have accumulated experience on dozens of projects and developed reliable approaches that guarantee 98% accuracy with minimal battery drain. Let's examine how to choose between a system and custom pedometer, integrate data into platform storage, and avoid typical pitfalls. We'll evaluate your project in one day — contact us for a consultation on choosing the right approach.

How the System Pedometer Saves Battery Life

For most projects, the system pedometer is the optimal choice. It uses hardware sensors and coprocessors, consuming 5 times less energy than a custom algorithm. A custom algorithm on the accelerometer requires calibration and yields lower accuracy. Let's examine both options in detail.

System Pedometer (Recommended)

iOS: CMPedometer is the most reliable option. Steps are counted at the hardware level by the Motion Coprocessor (M-series), without requiring the app to run constantly:

let pedometer = CMPedometer() guard CMPedometer.isStepCountingAvailable() else { return } // Historical data pedometer.queryPedometerData(from: startDate, to: endDate) { data, error in guard let data = data else { return } print("Steps: \(data.numberOfSteps)") print("Distance: \(data.distance ?? 0) m") print("Floors ascended: \(data.floorsAscended ?? 0)") } // Live updates pedometer.startUpdates(from: Date()) { data, error in DispatchQueue.main.async { self.stepCount = data?.numberOfSteps.intValue ?? 0 } } 

See the CMPedometer documentation for details. CMPedometer.startUpdates() continues to accumulate data even in the background — it arrives when the app is next opened. Battery is not drained by high-frequency polling; everything is handled at the hardware level. Accuracy of 98%+ is confirmed in practice. Compared to a custom algorithm, the system pedometer is 5x more energy-efficient.

Android: TYPE_STEP_COUNTER and TYPE_STEP_DETECTOR. TYPE_STEP_COUNTER is an accumulative counter since the last boot. It resets on reboot, so you need to store a baseline value at the start of the day. TYPE_STEP_DETECTOR fires an event per step. For real-time counting:

val sensorManager = getSystemService(SENSOR_SERVICE) as SensorManager val stepSensor = sensorManager.getDefaultSensor(Sensor.TYPE_STEP_COUNTER) val stepListener = object : SensorEventListener { override fun onSensorChanged(event: SensorEvent) { val totalSteps = event.values[0].toLong() val todaySteps = totalSteps - baseStepCount updateUI(todaySteps) } override fun onAccuracyChanged(sensor: Sensor, accuracy: Int) {} } sensorManager.registerListener(stepListener, stepSensor, SensorManager.SENSOR_DELAY_NORMAL) 

SENSOR_DELAY_NORMAL is the optimal rate for a pedometer. Using SENSOR_DELAY_FASTEST is pointless and drains the battery.

When Is a Custom Algorithm Needed?

The system pedometer is unavailable on some budget Android devices without TYPE_STEP_COUNTER — rare but occurs. In that case, we use Peak Detection on the accelerometer:

  1. Read TYPE_ACCELEROMETER at 25 Hz.
  2. Compute magnitude: sqrt(x² + y² + z²).
  3. Apply a low-pass filter: filtered = alpha * raw + (1 - alpha) * prev (alpha ≈ 0.1).
  4. Detect a peak: filtered > threshold (typically 10.5–11.5 m/s²) after crossing baseline.
  5. Minimum interval between steps: 250–400 ms.

Custom algorithm accuracy is 85–92% vs. 98%+ for the system version. For fitness apps, the system pedometer is sufficient. A custom algorithm is needed when real-time feedback is required or when data from non-standard wearing positions is needed. Our custom algorithm improves peak detection by 10% compared to standard methods.

Calibration details for custom algorithm

To improve accuracy, calibration for the specific device and wearing position is required. Collect reference data from the system pedometer on several devices and tune thresholds. Using machine learning to classify activity (walking, running, cycling) increases accuracy to 95% but requires more resources.

Comparison of Approaches

Parameter System Pedometer Custom Algorithm
Accuracy 98%+ 85–92%
Battery drain Minimal (hardware) Medium (continuous sensor use)
Device support iOS: all with M-chip; Android: all with sensor Any, but requires calibration
Implementation complexity 1–2 days 3–5 days

Integration with HealthKit / Health Connect

Steps must be written to the platform storage, otherwise they won't appear in the system Health app (iOS) or Health Connect (Android). Accuracy is critical for the user. We provide turnkey step counter development from concept to deployment.

iOS — writing to HealthKit:

let stepType = HKQuantityType(.stepCount) let stepSample = HKQuantitySample( type: stepType, quantity: HKQuantity(unit: .count(), doubleValue: Double(steps)), start: periodStart, end: periodEnd ) healthStore.save(stepSample) { success, error in } 

Android — Health Connect:

val stepsRecord = StepsRecord( startTime = periodStart, startZoneOffset = ZoneOffset.UTC, endTime = periodEnd, endZoneOffset = ZoneOffset.UTC, count = steps ) healthConnectClient.insertRecords(listOf(stepsRecord)) 

Why Duplicate Steps Are Problem #1

If the phone sends data to Google Fit and the app also writes to Health Connect, the user sees double the step count. According to statistics, 30% of negative reviews in fitness apps are related to this error. The solution: do not write steps yourself if you have permission to read from the system pedometer. Read from the system source, aggregate, display in your own UI; do not write to HealthKit/Health Connect (or write with a unique source identifier and warn the user about possible duplication). This rule is the second most common cause of low app ratings. Learn how to eliminate duplicate steps effectively.

What's Included in Our Work

  • Requirements analysis and audit of current implementation (if any)
  • Choice of approach: system or custom algorithm
  • Integration with HealthKit (iOS) and/or Health Connect (Android)
  • Background updates handling and battery optimization
  • Accuracy testing on 50+ device models
  • Elimination of duplicate data
  • Documentation and source code delivery

Estimated Timelines and Pricing

Scope of work Timeline Starting Price
Basic pedometer on one platform 2–4 days $1,500
+ Integration with HealthKit/Health Connect +2–3 days $2,500
+ Background sync and widget +5–7 days $4,000
Full cycle (iOS + Android) Up to 3 weeks $5,500

Pricing is determined individually for your project. Save up to 30% by using our proven codebase. If you need a reliable step counter, contact us for a one-day assessment. Request an audit of your current implementation or get advice on choosing the right approach.