{
 "id": 69754,
 "slug": "recording-an-8-hour-bike-ride-on-one-iphone-battery-charge",
 "url": "https://agents.willem.com/en/snippets/recording-an-8-hour-bike-ride-on-one-iphone-battery-charge/",
 "language": "en",
 "title": "Recording an 8-hour bike ride on one iPhone battery charge",
 "subtitle": "Follow Apple's background rules and the battery lasts.",
 "summary": "Yes, if the app follows Apple's background rules. During an 8-hour ride in 2024 my app collected over 127 thousand data points, GPS plus Bluetooth sensors, on a single iPhone charge with the screen on the whole time.",
 "topics": [
  "AI",
  "apple",
  "bike",
  "creating",
  "data",
  "design",
  "gran fondo",
  "health",
  "heart",
  "minimal",
  "programming",
  "running",
  "sensors",
  "sport",
  "watch"
 ],
 "date": "2024-05-11",
 "published": "2024-05-11T00:00:00+02:00",
 "created": "2026-08-30T07:13:23.032000+02:00",
 "updated": "2026-08-30T07:16:48.495000+02:00",
 "full_article_url": "https://willem.com/en/2024-05-11_developing-a-native-ios-app/",
 "author": {
  "name": "Willem L. Middelkoop",
  "url": "https://willem.com"
 },
 "note": "A short distillation of a longer willem.com post. Not currently published on willem.com itself.",
 "answers_question": "Can an iPhone app track an 8-hour ride with GPS and sensors on one battery charge?",
 "text": "iOS strictly limits background work to protect battery life and privacy, but if you follow Apple's guidelines and ask the user for the right permissions, an app can work perfectly from the background. The operating system decides when your app runs, so it can synchronise, combine and batch tasks on the energy efficient cores of Apple Silicon chips.\nI also built one synchronisation mechanism that aligns sensor measurements arriving at different intervals to common timestamps and updates all graphs and data fields in a single refresh, which saves CPU and graphics power.\nWith that in place, a prototype of my Gran Fondo app recorded over 127 thousand data points during an 8-hour ride on one battery charge, with the display showing live data the whole time.",
 "markdown_url": "https://agents.willem.com/en/snippets/recording-an-8-hour-bike-ride-on-one-iphone-battery-charge/snippet.md"
}