Leonardo Clock app widget

This is a programming project I’ve been working on for fun and practice. It’s an Android app that is a home screen widget, meaning it displays actual app content, not just an icon, on the home screen.

Like my Harbor Terminal project, this was an effort to recreate something I saw in a dream (and it won’t be the last). I was motivated for many of the same reasons as with that painting.

A few months ago I dreamt I was visiting a museum dedicated to Leonardo da Vinci (I was reading a biography of him at the time); it was at his place of birth and was filled with his inventions. There I saw, among other less-defined objects, this giant floating clock face with odd circular hands and letters on the ends.

Clock image with a small hand at 8:30 displaying an "n" and a larger hand at 12 displaying an "A".

I guessed it was some kind of clock but couldn’t figure out how to read it. My dad was there giving me hints to help me figure it out. It’s a clock—so it has to do with time—so what would the “A” stand for? …The “A” stood for “afternoon” and the “n” stood for “now.” The “now” hand pointed to the current time, as the hour hand does on a regular clock. The “A” hand simply marked when the afternoon would begin. When the “now” hand reached it, it would rotate down and set itself to “E” for evening and then later “D” for day. The two arrows on the “now” hand simply designated the times “earlier” and “later.”

clock image with a small hand at 12 displaying an "n", and the large hand at seven, displaying an "E".

Afternoon is reached; the large hand moves to “evening.”

I know that this is an extremely inefficient design for a clock, if you could even call it a clock. But when I woke up and realized it was a dream, I was fascinated that it actually made sense as a system with logical rules. Equally, I was fascinated that my unconscious mind had created this system before I was able to consciously understand it in the dream (and only with the help of dream-Dad). So I committed myself to recreating it as an Android widget, so that I could be pleasantly reminded of the dream when I’d see it on my phone, and to prove to myself that I could do it. That second reason was significant, because this project would test my art skills, programming skills, and my ability to teach myself whatever I needed to know in order to finish it (I’d never made an Android widget). Replicating a dream idea is different than building a useful app; on one hand, you don’t have to worry about what problem it will solve or whether it’s the best solution, but on the other hand, you cannot make any compromises on the look or behavior that you’d originally envisioned, or else what is the point?

The art was straightforward, although I definitely took some extra time to make it a precise representation of the memory. I made all the image assets in Blender; I didn’t need to use Photoshop, as I’m getting more experienced using Blender’s node editor system for fine-tuned visual effects.

Blender window with 3D object and material nodes

Nodes aren’t as scary as they look. But they are scary.

The programming was more difficult than I expected. Android places many restrictions on what you can do in a home screen widget, because unlike regular apps, widgets all run in the same process and can slow down the home screen itself if they are too calculation-heavy. This particular project wasn’t very calculation-heavy, but I still had to figure out several workarounds to get it behaving as I wanted. I also didn’t anticipate the work that would be required to set the “day” and “evening” times for the clock. I chose to use local sunrise and sunset times, which required occasional recalculation to adjust for the changing time of year as well as occasional location updates. I had to set these updates to happen often enough that the widget was accurate but not so often as to be wasteful of system resources. Luckily, I found a library that did all the math of calculating sunrise and sunset times, given the date and location.

In the end I’m quite happy with how this turned out, and I learned a lot.

download Leonardo Clock Widget for Android 

The clock image displayed on an Android home screen.

Share:

Leave a Reply

Your email address will not be published. Required fields are marked *