iPhone Walk Tracker/Mapper Application
I walk almost every day, and I like to keep track of my walks with my iPhone, and as a plus, keep track of my calories. There are a number of apps on the app store that do this, but they are all bloated, expensive, and/or use annoying ad mechanics. I decided to create a personal GPS walker app that has just the features I wantedI called it “Valker” because I wanted it to be a lightweight app for Walkers (“V” is half the size of “W”). The app I was using had a lot of features, but it had become so bloated that it took forever to start up.
I love my iPhone, but I never really cared for Objective C, which was needed to write apps for iOS. Then, Apple released Swift, which is a joy to code in. It cleans up alot of the crud from Objective C, has much cleaner syntax, and has been updated to include modern language features, such as closures and generics. And, it still generates native code, so the executables are lightning-fast.
Coding a GPS app provided many interesting challenges. The GPS is a radio so the app had to balance responsiveness, accuracy, and battery life. The more accuracy you request, the more the radio is used, which can greatly impact battery life.
On my iPhone, I can get an accuracy of about 5 meters. So the app has to filter the location updates from iOS. It needs to get frequent updates from iOS, but if it uses all of them, it greatly inflates the distances, due to the 5 meter error inherent in the GPS. This took quite a bit of tuning to get good accuracy, and yet still provide udpates to the user in a timely fashion.
Additionally, the phone doesn’t always get a 5 meter level of accuracy. First, it can take a few seconds for the iPhone to acquire the GPS signals. And, it also uses cell towers and wi-fi to improve accuracy. So, the initial readings can be wildly inaccurate.
Plus, even after a good signal is acquired, it can degrade due to the variations in the weather, location, etc. I like walking on trails in the woods, and sometimes, my phone can’t get the best accuracy levels in those conditions.
So, I put additional logic in the app to prefer using the “best” accuracy, but to fallback and allow a lesser degree of accuracy if it can’t obtain that level for a few seconds. It will always prefer the best accuracy, and only uses lesser accuracy when it has to.
Anyhow, I’m pretty happy with the app, it starts up quickly, is more accurate than the app I was using, and seems to use the battery fairly lightly (that is, for a GPS app–but GPS apps do like to drink deeply from the battery compared to other apps)
If you are interested in giving it a try, it is available for free on the App Store.