Thursday, September 12, 2019

Giant numerals stopwatch app

I do two activities where it is nice to have a stopwatch one can see from a distance: lap swimming and lap (indoor) rock climbing. I found one stopwatch app with large numerals, but they weren't large enough for my taste, so I ended up writing my own with the absolutely biggest digits I could (and lots of customizability and various extra features, like a start countdown).

For any Android users who want it, it's here. Source code is here. No ads, no in-app purchases. The app keeps track of the time even if it's navigated away from, and doesn't use any CPU time then. It should even continue keeping track of time if the device reboots or runs out of battery, though perhaps with some loss of precision. The lone permission in the app is to let it run on boot (to adjust the time in case it's running through a reboot).

For climbing, I leave my phone on the ground and easily read it from 50 feet up. For swimming, I put the phone in a freezer bag, and stand it up by the edge of the pool. In foggy dark goggles, I can read it from several yards away, which is good enough for pacing. (Our pool only has one analog wall clock which I can't read in foggy goggles.) Having time feedback as I swam encouraged me to improve two of my swim times (maybe it helped with pacing, too).

Curiously, in an early version I found that there is some bug in the font renderer on my phone: at maximum size, some digits were left blank on the screen (perhaps nobody anticipated drawing text so large that if it had descenders they wouldn't fit on the screen). So I wrote a python script that used a font library to convert digits, colons and minus signs to java code with the Android Path class.

The landscape screenshot shows it running in fullscreen mode with the classic German DIN 1451 highway sign font (and aspect ratio preservation turned off for even bigger digits). The second is with a standard Android Roboto font.



No comments:

Post a Comment