Android ListView and other Trials and Tribulations

So, I am currently in the midst of upgrading Electric Dawn to provide multiple alarm profiles. But the going certainly hasn’t been easy. However, I have stumbled on an excellent resource for ListViews and Adapters in Android.

Google I/O 2010 – The world of ListView by Romain Guy and Adam Powell is a fantastic resource. There are so many flawed examples of using ListView out there on StackExchange, blogs, tech sites etc. and then in complete contrast there is the definitive presentation from Google I/O 2010 that just shows you how it is supposed to be used. Brilliant!

In other news, my Samsung S3 has died completely. The symptoms look like it could be the widely written Samsung Sudden Death Syndrome. So I am now back to using my old HTC Desire (Bravo) which is now running CyanogenMod 7.2 – Android 2.3.7. It’s quite nice having a small phone again, though the limited internal memory and short battery life are still a problem.

Not too long now until the next release of Electric Dawn with added Multiple Alarm Profiles. 🙂

Bitbucket and Git

So this week, as part of the tidying and organising activities, Electric Dawn has now moved over to Bitbucket and Git for its version control.

For some time now version control and backups had been managed on a local Linux server with Subversion and scripts to regularly dump to backup. But with the drive to improve various aspects of the IT (including the recent move to WordPress) a cloud-based version control system looked more appealing. GitHub was the obvious first port of call, but for a small, fledgling company the prices are still too high for a private repository. Bitbucket on the other hand (who now support Git as well as Mercurial) is free for private repositories with small teams. Which is perfect!

Sunrise Alarm

Why build a sunrise alarm clock?

I am not a winter person. Those dark wet and miserable mornings are not conducive to me leaving a comfy warm bed. The summer however is a different matter. I wake with the sunrise, and (unless I’ve been out the night before) will be awake and wanting to get up and go early. I intentionally moved to a place where the master bedroom faces East(ish) so for about half of the year I have the joy of being woken naturally. But not in the winter.

Bird Family

istockphoto/claudelle

A few years ago I stumbled onto a website selling sunrise alarm clocks. They weren’t particularly cheap at the time, and had only basic functionality, but seemed worth trying to beat those winter blues. I bought a Sunrise System alarm clock that is similar to the current SRS 250 dawn simulator with MP3 player. It certainly improved matters, I was waking feeling less groggy than prior to using a sunrise alarm. I used this for a couple of years until I moved house and unfortunately broke the lamp in the move. I had a look at repairing it, but never did work out what was wrong. It was too expensive at that time for me to be able to afford a replacement so I went back to using a phone alarm clock. (It was summer anyway, so wasn’t too pressing an issue).

Android apps

Sometime later that summer I bought my first Android smart phone and started dabbling with Apps. Given that phones these days have sizeable screens and camera flash LEDs it seemed feasible to use them as dawn simulators. The one downside is the absolute level of brightness is considerably less than a 40W incandescent lightbulb. But when used in a darkened room (blackouts in the summer, or your average winter morning) the light from the screen was sufficient to provide the same effect of a gradual dawn.

The first versions of Electric Dawn were definitely simplistic. It was all about functionality with little in the way of aesthetic gloss. After launching on the marketplace, nature sounds were added, along with weekday selection. The newer versions of Android, along with a myriad of devices, required occasional bug fixes and feature improvements. Then last year serious effort was put into the user interface. Working with a local graphics designer, I added a better look and feel and organisation of the settings. Recently I finally added an option of a more artistic and natural sunrise effect.

Wake up gently - Electric Dawn

Wake up gently – Electric Dawn

I decided from the outset, that every improvement would be shared amongst all the original users as well as newcomers. The feedback and help from users in finding and fixing bugs has been invaluable. So I want to make sure that they get to share in the rewards of a better sunrise alarm clock. Because of this, there is only one Electric Dawn by Whimsical Otter on the market and every user is entitled to every upgrade.

Work in progress

This is a continuous work in progress. I still want to find a way to incorporate the camera LED, but as yet haven’t found any way to effectively control the brightness. It is possible to switch it on and off, but not set brightness. (Although some may comment on the possibility of PWM, from experiments so far the switching rate is currently too slow and there is an obvious flickering).

I would also like to add the option for different alarm profiles. For example being able to have one alarm profile for weekdays, and one for weekends perhaps. The design of the database for storing multiple alarm settings did take this into account even in the first version of Electric Dawn. But as a perfectionist, I would like to refactor the current codebase to clean things up before making any further serious modifications. The bolting-on of new features and patching-up of bugs and issues with new Android versions has left the codebase looking a little rough around the edges.

Of course, this doesn’t take anything away from the rigourous testing that Electric Dawn goes through before any new release. I personally use it everyday, and have done since version one, and look forward to continuing the development.

Natural Sunrise

How do you simulate a sunrise on an Android device?

This was the question on my mind since the early days of developing Electric Dawn. But it was only recently, once I had worked with a graphics designer to improve the general look and feel of the overall app, that I was ready to tackle the Natural Sunrise.

It just so happens that the standard HSV colour cylinder provides the perfect blend path for a dawn sky from 240degs to 60degs via 360degs.

The Android app uses a SurfaceView allowing us to draw directly onto the canvas and build up the image. The sky colours followed by the sun and overlayed with the organic flourish stencil. Inspiration for the organic flourish stencil came from a tutorial by InkThisScape.

I’m quite happy with the results, and enjoy watching the virtual sunrise as I wake up each morning. Hopefully, you do too! 🙂