Scratching An Itch – A Home Brewed Tea Timer

notebook

There’s an old saying that goes something like this – “an awful lot of computer programs are written by someone with an itch they needed to scratch.

Well, in terms of my tea drinking habits, I did indeed have an irritation that needed seeing to.

For timing gong-fu sessions I was using an app on my phone, one called Simple Timer.

It worked OK, but had a couple of features I wasn’t entirely happy with.

Firstly, once the timer had counted down and set the alarm off, you had to manually switch it off, meaning you either had to delay pouring your tea, or do so with the alarm constantly sounding off until you were done.

Then there was the fact that after each countdown the timer reset itself to zero. Typically during a gong-fu session you want to have your next infusion a certain number of seconds longer than the previous one, meaning that it would make more sense for a gong-fu timer to have an option to bump up the value of the last round rather than having the user manually enter the value all over again.

I didn’t want to spend time trawling through the Google Play Store looking for something better, so decided to cobble together an alternative myself.

An Android app might have been a sensible idea, but that would have meant downloading, installing, and configuring the development environment, something I thought was a bit over-the-top for what was probably going to be a short, relatively simple project.

In the end I decided to do something using HTML, JavaScript, and CSS, meaning that it would run inside most web browsers. This would have the advantage of using nothing more complex than a text editor to actually write the stuff. I could then drop the finished item onto the web server that sits on our local network, making it accessible from any device capable of running a web browser – laptops, desktops, phones, and tablets alike. This solution would also work out of the box for other platforms, i.e. not be Android specific.

You could even take it out on the road with you, by copying all the necessary files to a local folder on your device of choice, and simply pointing your web browser at that, rather than the network.

Anyway, after a few hours playing around I have a working prototype, assembled from code fragments *cough* borrowed from w3schools.com, which is a great resource if you enjoy playing around with this kind of technology.

Basically, it all boils down to three buttons – one to add 5 seconds to the current infusion time, another to add 10 seconds to the current infusion time, and a third to start the timer. Two text areas display the currently set time as well as other messages, i.e. time left, and so on. The browser plays a small, short mp3 file once and once only when the countdown has finished.

DOANT tea timer running

The timer can be reset simply by refreshing the page, as the default countdown value on starting is zero seconds.

So far I’m really pleased with the results – it’s scratched my two major itches!

No software project’s prefect, however, even one as small and simple as this one, and there’s still a few things left to do.

First and foremost I plan to do an accuracy check. On short infusion times any discrepancies wouldn’t be all that large, but over the course of a multi-minute steeping it might possibly drift a fair bit, so I’m going to do a bit of calibration and amend/tidy up the code if I need to.

I might add extra buttons for +30/60 seconds, as well as a duplicate set of buttons that remove the appropriate number of seconds, too. The need to do this or not will hopefully become more apparent after I’ve used the app for a while.

Then, when everything’s working just right, I might want to tidy the thing up aesthetically.

Another sensible idea would be to test it on other platforms and browsers – just now I’ve only tested it on Google Chrome running on Android.

Finally, if I’m happy enough and not too embarrassed by it, I might just open it up for anyone else who might find a use for it.

Watch this space, etc.

Advertisement
This entry was posted in tea making techniques and tagged , , , . Bookmark the permalink.

3 Responses to Scratching An Itch – A Home Brewed Tea Timer

  1. Jenn Robinson says:

    Any chance it might eventually be available for iOS?

    Liked by 1 person

    • Hi Jenn

      Because it runs in a browser window, it should work on iOS too. Once it’s charged I’ll run some tests on Junior’s iPad.

      I can also test it on Safari et al on Mac OSX. There shouldn’t be a problem because I’m fairly sure they’re all standards compliant.

      Liked by 1 person

      • Hi again Jenn,

        It turns out that iOS implements some of the HTML stuff a little differently!

        Initially it meant that although the app worked as expected on Android, the alarm notification wouldn’t work on iOS. Basically, they don’t want iOS to play sounds without some kind of user interaction, such as a button press, happening first. What caught me out was that I was doing just that, but not in an iOS friendly way.

        After a bit of research I’ve found a way that now works on iOS and still works on Android. 🙂

        Like

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.