Building a Fitness Tracker App for iOS and Android

Building a Fitness Tracker App for iOS and Android A fitness app is more than a step counter and pretty charts. Behind every sensor is a separate API with sampling rate limits, background access policies, and permissions that Apple and Google tighten with each release. We develop native fitness t

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
Building a Fitness Tracker App for iOS and Android
Complex
from 1 week to 3 months

Our competencies:

Frequently Asked Questions

Latest works

  • image_mobile-applications_feedme_467_0.webp
    Development of a mobile application for FEEDME
    894
  • 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

Building a Fitness Tracker App for iOS and Android

A fitness app is more than a step counter and pretty charts. Behind every sensor is a separate API with sampling rate limits, background access policies, and permissions that Apple and Google tighten with each release. We develop native fitness trackers for iOS and Android that correctly work with CoreMotion, HealthKit, Google Fit, and Health Connect simultaneously — significantly more complex than most other mobile categories. We will evaluate your project in 1 day — contact us for a consultation.

How a Fitness Tracker Works on iOS and Android

Which Sensors and Why

Sensor iOS API Android API Typical Frequency Power Consumption (per hour)
Accelerometer CMMotionManager SensorManager (TYPE_ACCELEROMETER) 50–100 Hz 15–20% at 100 Hz
Gyroscope CMMotionManager SensorManager (TYPE_GYROSCOPE) 50–100 Hz 12–18% at 100 Hz
Barometer CMAltimeter SensorManager (TYPE_PRESSURE) 1–10 Hz 3–5%
Pedometer CMPedometer StepCounterSensor / Health Connect Cumulative < 5%
Heart Rate HealthKit (from Watch) Health Connect On event < 2%
GPS CLLocationManager FusedLocationProviderClient 1 Hz for tracking 30–40% during continuous tracking

High-frequency accelerometer polling (100 Hz) in the background is a direct path to battery drain in 3–4 hours. On iOS, CMMotionManager.startDeviceMotionUpdates() with UIBackgroundModes: processing and BGProcessingTask allows batch processing, but background execution is limited to 30 seconds. On Android, WorkManager with ExpeditedWork or Foreground Service with type FOREGROUND_SERVICE_TYPE_HEALTH. Using the system pedometer CMPedometer reduces power consumption by 40% compared to a custom algorithm.

CoreMotion and Activity Detection

CMMotionActivityManager.startActivityUpdates() provides ready activities: walking, running, cycling, automotive, stationary. This is better than analyzing the accelerometer yourself for most tasks. However, there is a nuance: classification arrives with a 5–30 second delay (iOS averages data) and only works if CMMotionActivityManager.isActivityAvailable() returns true — unavailable on some iPod Touch models.

For a custom step detection algorithm from the accelerometer: peak of vertical acceleration (Y-axis) with threshold > 1.2g at 50 Hz. Minimum interval between two peaks is 300 ms (step frequency no higher than ~3.3 Hz). This is a basic implementation. An accurate algorithm considers phone placement (pocket/hand/backpack) via a classifier using CoreML or TensorFlow Lite — recognition accuracy reaches 95%.

GPS Route Tracking

CLLocationManager with desiredAccuracy: kCLLocationAccuracyBest in the background requires Always permission and UIBackgroundModes: location. Without this, updates stop after 10–15 seconds in background. On Android, FusedLocationProviderClient with LocationRequest.PRIORITY_HIGH_ACCURACY in a Foreground Service.

Problem: urban canyons and tunnels — GPS is lost, track breaks. Solution: when horizontalAccuracy > 30 m — don't record the point. Dead reckoning using accelerometer/gyroscope during signal loss is more complex but provides a continuous track.

Recording the track in GPX format: standard XML, each point is <trkpt lat="..." lon="..."> with <ele> and <time>. GPX export/import is a de facto standard for compatibility with Garmin, Strava, Komoot.

Why Background Execution Is the Main Challenge

The hardest part of a fitness app is correct background operation without killing the battery. Principles:

  • Keep high-frequency sensors active only during active workouts
  • On iOS, use BGAppRefreshTask for syncing statistics (not for tracking itself)
  • Cache data locally in SQLite / Core Data, sync with server in batches after workout completion
  • CMPedometer and StepCounterSensor are system pedometers that work at the OS level without our involvement; we only read data

The system pedometer CMPedometer is 3× faster than a custom algorithm and consumes 60% less power. Our 10+ years of mobile development experience allows us to choose the optimal combination of APIs for each task.

Integration with Platform Health Stores

On iOS, all workout records must be saved via HKWorkout in HealthKit. Without this, the app won't appear in the Health app, and users will perceive it as a bug. HKWorkoutBuilder is the right approach: it lets you add samples (heart rate, distance, calories) during the workout, not in a batch at the end. HKWorkoutRoute saves the GPS track linked to the workout.

On Android — Health Connect (androidx.health.connect.client). We write ExerciseSessionRecord with activity type, DistanceRecord, TotalCaloriesBurnedRecord. Important: Health Connect requires a licensing agreement with Google and a separate review when publishing to Play Store if the app reads medical data. Over 50 of our projects have passed this process.

What You Get

As a result, you receive a fully working turnkey application:

  • Source code in Swift/Kotlin/Dart with comments
  • API and architecture documentation
  • Access to App Store and Google Play developer accounts
  • Integration with HealthKit/Health Connect and Google Fit
  • Push notification setup via APNs/FCM
  • 3 months of support after release
  • Training for your team on working with the code
Common Mistakes in Fitness Tracker Development
  • Ignoring App Store Review policies on HealthKit usage — leads to app rejection
  • Lack of graceful degradation when GPS signal is lost — user sees a broken track
  • Overly frequent sensor polling in the background — battery drains in 2–3 hours
  • Incorrect permission handling (Away/Always) — app crashes or doesn't work in background
  • No synchronization with system health stores — users complain about incomplete data

Each of these mistakes has been fixed by us in real projects. We guarantee your app will pass review and won't be rejected for these reasons.

Timeline and Cost

An app with basic activities (walking, running, cycling), GPS tracking, HealthKit/Health Connect, and statistics — 8–14 weeks. With custom activity detection algorithms, ML classification, and social features — from 4 months. Cost is calculated individually based on your requirements. Get a consultation and accurate estimate — contact us.