Search

There will now be a short Interval

Hi all, hope you are well! It's been three weeks since my last blog and you may have been wondering what I've been up to. As I mentioned last time out, I decided to pause work on Number Ten for a few days to focus on another idea I've had, namely a fitness app for interval training. In this week's blog I'll give an update on how that's gone and talk about the future roadmap for my app projects.

Celebrating my still-fastest 10k back in 2009 with my daughter Felicity. We've both changed quite a bit since then...

As 2020 has unfolded, my plans for working full time on app development have taken a few hits. Like many of you, Covid-19 has brought us home schooling commitments since March. I was fortunate that Mrs E was able to pick up the majority of this, so initially this just meant shifting my working day around to get the hours in, but since my better half went full time in June I've had to reduce my apping hours. I always knew building even a reduced version of a politics simulation app was a tall order for one person in a few months, but in the last few weeks it's clear that it's become an almost impossible one. With that in mind, I've started to look at options for building an app on a much smaller scale, to enable me to get something published on the App Store. The obvious next question was, what?


The answer has come partly from lockdown itself. With the closure of swimming pools and restrictions on all sports not deemed free from risk of spreading infection (basically, all sports...), like many people I've turned to running to keep fit. I'm not a novice by any means but I'm certainly not what you'd call a serious runner. My 10k PB is a shade under 48 minutes and my half marathon best of just under 2 hours won't be beaten by these near-50-year old legs again. I do, though, have friends who are, and I turned to them for advice on how I might improve my speed (if you can use a word with such pacy connotations about my plodding gait).


"Are you doing any fartleks?" enquired one.

"Er, yes that might be me," I replied sheepishly, "but it was a particularly tasty lamb bhuna we had last night, and besides, how does that help my running?"

"Fartleks, you berk," came the reply. "Interval training. From the Swedish. It means 'speed play'. It can help you increase your pace."

"Ah, I see. Er, no. Tell me more."


And so I learned about how running short distances of high speeds can help train the body to become accustomed to the faster pace, which will enable you to maintain that speed over the longer distances. One recommended pattern is to run a medium distance, say 400m, at the fastest pace you can, then walk for a period of say 30 to 60 seconds, then follow that with another run/walk pattern but over shorter distances and times, say 200m with a 15-30 seconds rest. The session then "peaks" with a 100m sprint, followed by another rest, then another 200m, rest, and finish with another 400m - I think you get the idea.


"I could use my Apple Watch for this" I thought. A quick search on the App Store found a host of interval running apps, all with their own individual settings and recommended patterns.

"Running gurus, which interval pattern do you recommend?" I asked.

"Pattern? PATTERN?! Who needs patterns!" scoffed one. "Free your mind! Free your body! Take it out there and do what feels natural! Don't be constrained by such rigid thinking! You will never reach running nirvana that way!"


OK, I paraphrase, but as Simon had successfully completed the Marathons de Sables race in the Sahara, he was obviously a man to be listened to. What we need then, I thought, is an app that just detects when you're running, walking and at rest, and does the tracking for you. But searching through the twenty-odd running apps I'd downloaded, I could find none that offered such auto-detection - at least not for free. I felt an app idea coming on...


"Well Michael Johnson has a unique running style, and it works for him!!" My patented "plodging through a pool of glue" running gait. The chap to my left shows how it's done. The big question is, how on earth am I ahead of him with that stride??

And with that in mind, three weeks ago I started working on "FiT", to use its working title (an acronym of Fartlek Interval Tracker, can you see what I did there?). My first task was to confirm that auto-detection of activity types is possible - after all, why has no-one done this before? I spent the first couple of days familiarising myself with Apple's world of motion tracking objects (Core Motion, they call it), poring through documentation and then downloading and understanding sample code.


By the end of the first week I managed to get this working on the iPhone, and my first pieces of real-world testing confirmed that the device could indeed detect different motion types. The next step was to capture the intervals themselves. For folks of a technical disposition, this meant combining data from two Core Motion objects - the Activity Manager, which tracked the type of activity being performed (walking, running, stationary) and the Pedometer, which tracked the actual movement data and translated it into distance, duration, pace, cadence and other metrics. This is where the complexities emerged... nothing is ever completely straightforward! You might reasonably expect the two objects to be aligned - in simple terms, if the Activity Manager says the phone is stationary, there should be no distance, duration or pace recorded by the Pedometer. But no - although there is a good deal of alignment, as you'd expect, the Pedometer was still recording motion even when the Activity Manager was insisting I was stationary.


What to do? Had I reached the end of the metaphorical road? Well, I thought, let's get it working on the Apple Watch now, and see if the watch's more advanced tracking features manage to resolve the issue. That's where I'm at currently, having managed to build my first Apple Watch app, and get it talking to the iPhone. Currently that conversation is no more detailed than "I'm here! Please display a label in this random colour I've just created", but it proves the connectivity is there (readers of my previous blogs will recognise that as one of the "YESS! IT F***ING WORKS!!" moments that make development so much fun). Next task is to get the interval tracking logic ported to the watch, and see the results. If I'm lucky, the watch will do a better job of detecting motion, and I won't have to make any refinements to my interval detection logic, but we'll just have to see.


So, assuming all goes well, what are the next steps, and what does this mean for my beloved politics app?


I'm already getting close to the point where I can start to think about creating an App Store submission for "FiT". I've heard horror stories about how convoluted a process that can be, with tales of how Apple's rigorous code-checking and quality procedures requiring countless rewrites and updates, but the only way to really find out is go through it myself. At this point I'm not planning any marketing or PR campaign for the app, it's as much about getting an app out there as it is about making any money - I'll be pricing it for free with the only income stream possibly being through embedded ads on the iPhone version.


I'm still weighing up if I want to make app development a full time job after this. I'm thoroughly enjoying it, and there are vacancies out there... whether it's the right role for someone about to hit their half-century is another matter. But if I do want to go down that route, having a published app is a common "must have" on job specs, so at the very least this would be a tick in that box.


As for Number Ten, I honestly can't say for certain at this point whether delivery is possible in 2020 or not. Covid and now schooling commitments have definitely hit my schedule, and with Mrs E's new role, I'll be only able to grab a few hours over the summer holidays. Like many of you, I'm really waiting to see what September brings. If schools return full time, I'll be able to return to full-time work, and if that happens, there's a fighting chance for the game. Time will tell.


One last thing. I hope this blog is useful and entertaining - I am enjoying writing it, and I have had some positive feedback! If you do have any comments, feel free to drop me a line at richard@numbertengame.co.uk. I send them out into the websphere in the hope they provide some value and entertainment, and to borrow a quote from a favourite film of mine, if it brings a little joy into your humdrum lives, it makes me feel as if my hard work ain't been in vain for nothing.


And on that note, I'll crack on. My son is in school for his one day of the summer term, so I intend to use the time wisely! Take care, and speak soon,


Richard





32 views0 comments

Recent Posts

See All