MileageTracker


Everyone at work has been ribbing me over a little mobile application I’ve been developing. I don’t get it – I think it’s great. I carry this phone around with me everywhere. Once in a while I make / receive a call on it but it can do so much more. I used to have a little application on it that stored password and card details and the like but I never really used it TBH. Then one day I come up with a great use for my SmartPhone and everyone else thinks it’s a waste of time… Hmmm…


I like to keep a track of my business mileage. That way I can at least feel better about recovering a little bit of money from HM Inspector of Taxes. Usually I do that on a little red notepad I keep in the car. Then at some point I transcribe all those details to a spreadsheet to submit to our finance people or at least to keep a copy for the taxman. Of course sometimes I write things in the wrong place in the book (I know, it’s not that difficult to get this right but I change cars quite a lot – expensive hobby – and it can get quite confusing). And sometimes I forget to write it in. And when I remember I’m not in the car so the book’s not to hand etc etc. So I thought a little SmartPhone app would be perfect.


I called it MileageTracker and only as I came to write this did I realize that someone has already TM’d that name with an application that does pretty much the same thing for a range of mobile devices (though not the SmartPhone so my time was well spent and I’m probably too tight to shell out $15 in any case). So I have to come up with another name…


What does my (unnamed – that could prove to be the trickiest part) application do? Well, you enter in the destinations of interest and you can then enter journey details including date, start, finish, distance and final odometer reading. These are stored in XML files on the device and it remembers things like the most recent destination, distances between places and the last odometer reading to help you out by pre-populating fields. At some stage (when I feel like it) I then submit these journeys to a web service that stores them in a SQL Server database for me. The web service also allows me to retrieve a list of journeys for a certain time period for reporting purposes. The application looks a little like this…



Along the way I hit a few snags as you’d expect. The biggest snag was that my SmartPhone is a 2003 device so it’s running Compact Framework 1.0. This isn’t a snag in itself, it’s just that whenever you chat to anyone about the best method to accomplish something, their suggestion inevitably utilizes a feature(s) only available in Fx 2.0. When you mention that it’s a Compact Framework 1.0 application, so you’re working within some constraints, many of these so called “colleagues” lose interest in your dilemma and find something pressing that needs their immediate attention. And there you are, left on your own with only a plethora of Fx 1.0 classes for mates.


So I couldn’t take advantage of generics, or use static classes or some of the new XML capabilities but overall things went okay and the framework made light work of most of the challenges I faced. Where did I learn things?




  • Getting started with the SmartPhone emulator


  • Setting the tab order


  • Deployment onto my SmartPhone


  • Connectivity to the web service


  • Determining the application directory


  • XML handling


  • Setting the input mode to “numeric” for certain fields


  • Keeping the footprint to a minimum


  • InfoPath – what a great tool for dealing with XML data!

I’ll write up some of these learnings in future entries. For now I’m enjoying the new found freedom of my unnamed application and my little red notepad has been consigned to the bin!

Skip to main content