As many of you know, I’ve been running for the last year and few months, and completed a few races here and there. One of the first things you start to focus on when you sign up for your first race is your pace and predicted finish time. It’s a simple calculation of pace = time / distance. You might be thinking, “wait, speed is distance / time”, but runners usually measure pace in minutes per mile or kilometer, rather than kilometers or miles per hour. So if you know the length of your race and how fast you can run, you can predict when you’ll come in. Or if you have a goal for when you want to come in, you can calculate how fast you need run to meet that goal. Last, and probably least, if you know how fast you’ll be going and how long you’ll be running, you can predict how far you will go.
There are pace calculators all over the web, but none yet for Windows Phone 7. So I figured it would be a fun project to create one. It would give me a real world reason to use some of what I’ve been learning about Silverlight too. On the outset, it looked really simple. Three text boxes for time, distance, and pace, and three buttons. The toughest part was all the time conversion and formatting. I decided to break up the text boxes for time into separate ones for hours minutes and seconds. I added some preset distance buttons and a toggle for miles or kilometers. Here’s the final result:
I’m really impressed with Silverlight. I’ve done enough Flex work so that this was quite simple. Flex has never really grown on me, but I find I’m actually starting to like Silverlight. It feels much more robust and mature and well thought out than Flex.
Anyway, the whole app took just a few hours to code. I started it when I got home from work on Tuesday and it was done before I went to bed. Wednesday morning I made up a crappy icon, took a screenshot and submitted it to the WP7 marketplace. Wednesday evening I got an email saying it was approved and the next morning (today) it was live and available for download. After having waits of up to 3 weeks for iOS app store approval, this blew my mind. Of course, the MS marketplace is young and lower traffic and will feel its own stress points as it grows. But I’m willing to bet that it remains a much more streamlined experience. Developers, developers, developers! Right?
I think this app will continue to be a great way for me to learn more about Silverlight and tweak things. I already worked a bit on input validation. When you enter an input field, a keyboard comes up just like on other devices. I had made it so that a telephone numeric keyboard comes up since you only enter numbers there. But there are still invalid characters that one could enter, such as “,+=#”, space, or “.” in the time fields. So I just did an update that restricts those characters and limits the number fields to two digits. I also started working on better layout using a few grids in key spots. I may even experiment with changing it to a panorama control, adding another page for maybe calculating splits (where you’d have to be at each mile or kilometer to be on track for your goal time), or other useful info.
Long and short of it, I’m having fun. The app is free by the way, so it’s totally for fun and learning, and of course because I find it a useful app personally. I’m also forming an idea for another game. Having fun is fun!