Color Picker for Android

Color Picker with HSV sliders and mini-palette for Lightbox on Android.

Color Picker on a Tablet with HSV sliders and mini-palette for Lightbox on Android.

The Lightbox app allows users to alter the colour displayed on the lightbox screen. Previous colour-pickers used in Lightbox were sufficient for general use but lacked the fine control needed for some applications. The new colour picker provides three large controls for tweaking the hue, saturation and value aspects of a given colour. This means that for colours close to white it is now possible to finely tune the hue and saturation independently. There are also a few standard colours in the mini-palette to quickly jump to full white, red, yellow, green, blue or magenta. The original colour and the new colour swatches are also displayed allowing the user to reset to the original colour as a starting point. On larger displays, the controls will expand to make full use of the screen space (in portrait or landscape) for even finer control for the user.

The mini-palette uses the AspectGrid from StackOverflow to provide a nice grid layout. The Hue, Saturation and Value sliders are derived from the SurfaceView with the canvas painted using the LinearGradient for background and a simple stroke line for the slider marker.

This provides a simple, but effective solution. There are also many alternatives if you are looking for solutions, with some particularly flexible and stylish implementations such as HoloColorPicker.

AndroidTapp Review of Electric Dawn

Recently Electric Dawn was reviewed over on AndroidTapp in a well written, thorough and constructive review. There are some great points raised, and below I’ve expanded on some of these. It’s always good to hear from people who are using these apps to understand what works for them and what could be improved to make the app work better for them. It’s through this process that has seen Electric Dawn evolve over the years to it’s present state, and what will see it continue to improve over the coming years.

The point about limited nature sounds included is quite right. The sounds themselves are high-quality recordings over longer durations (each is around 2 minutes long) to prevent looping too often and provide a more realistic ambience. In the early days of Android devices app size was critical so the number of sounds was kept small to keep the size of the app down. Now though, with more memory available, we can look at adding more sounds to the app! :) Any suggestions for what sounds people would like included are always welcome.

With regards to the feature set of other gentle wake alarms compared to Electric Dawn, we decided that keeping the app as simple and robust as possible whilst still providing flexibility was the strongest feature we could have. That’s why the improvements over the years have been carefully thought through and implemented gradually without compromising simplicity. We’re always happy to receive suggestions from users for improvements that would make the app great for them, but we will always keep the goal of a simple and robust app in mind.

So if you have any thoughts, feedback, or if you just want to say hello then get in touch and leave a reply :)

Daylight Lamp

Earlier this summer I stumbled on an article explaining how windowless work-spaces can cause sleep deprivation. This is based on the research and journal paper by Boubekri et al.

I spend my days working in an underground laboratory (albeit not in a hollowed out volcano) with fluorescent lighting and zero natural light. I had also noticed that my sleep was no longer as replenishing as it was when I worked at a desk in front of a south facing window.

So, as an experimental solution I purchased a lamp and daylight bulb and now illuminate my desk with this all day. I have found that gradually I am sleeping better and feeling much more rested when I wake. Correlation, though not necessarily causation – it’s certainly better having the daylight hues lighting the desk.

The lamp and daylight bulb are both available from John Lewis. Although the matching bulb is actually found in the craft department rather than the lighting department?!

John Lewis Elliot Task Lamp

John Lewis Elliot Task Lamp

Purelite Natural Daylight Bulb ES 15 Watt

Purelite Natural Daylight Bulb ES 15 Watt

This should also help during those long, dark, northern winters!

George / CompuRobot CGL - Front View

George CompuRobot CGL

Whilst tidying up my desk area I stumbled on an old George-bot (CGL CompuRobot) that I’d bought cheap on ebay some years ago. The electronics all work perfectly well, but a broken gear/cog means one of the wheels is undrivable. Eventually I may find a replacement gear, but in the meantime here are some photos showing some robust 1980s electronics.

George / CompuRobot CGL - Front View

George / CompuRobot CGL – Front View

George / CompuRobot CGL - Front View

George / CompuRobot CGL – Front View

George / CompuRobot CGL - Inside Front View

George / CompuRobot CGL – Inside Front View

George / CompuRobot CGL - Motors View

George / CompuRobot CGL – Motors View

George / CompuRobot CGL - Cogs, Gears and Differential Drive View

George / CompuRobot CGL – Cogs, Gears and Differential Drive View

George / CompuRobot CGL - PCB Circuit View

George / CompuRobot CGL – PCB Circuit View

George / CompuRobot CGL - Membrane Keypad PCB View

George / CompuRobot CGL – Membrane Keypad PCB View


"Bows and arrows against the lightning."

Android Game Development with libGDX

I had initially started development using Android and OpenGL ES using straightforward Java. But quickly ran into responsiveness issues due to naive use of Collections and the automatic garbage collector. After reading around the subject I stumbled onto libGDX (as mentioned in the previous post) and decided to start afresh. The library as a whole I found to be very straightforward to use. Great tools for setting up the initial projects. Excellent and expansive documentation for the API and cookbooks for actually making use of the library in your own application.

The result is a 2D game inspired by the arcade games played in my youth – The likes of Space Invaders, Silkworm and Missile Command to name a few.

PlanetKillers In-Game A

PlanetKillers In-Game Screenshot


The general concept is a sort of steampunk or more Wellsian-era battle of primitive weaponry versus vastly superior technology. “Bows and arrows against the lightning!”. You are in control of a train (Class A4 inspired) racing across the country whilst using the artillery cannon to shoot the aliens before they bomb you or make it to the other side of the screen.


All of the graphics and sprites were drawn using InkScape – a free vector graphics package. Although they were loaded into the game as PNGs (with alpha). This gives some future proofing for devices with much greater resolution screens. Ideally there would be a nice way to render SVG images directly in-game.


The libGDX setup tools produce everything you need to get started provided you have already installed the Eclipse IDE (with the ADT plugins and Android SDKs). The tutorials again are top-notch. The game can be executed as a desktop application, an Android application, a browser application or if you have suitable tools as an iOS application.

The resultant game is quite snappy, although there are still areas that can be better optimised (to make better use of the libGDX library) and optimise the graphics to be device resolution-specific.

The AI might also be a little too hard too soon for some lesser-skilled players. See how you get on.

Android app on Google Play


Android Game Development

I have been wanting to get back into developing simple arcade games for the last few years. With modern mobile devices packing some serious processing power it seemed like a good time to start again. Back then it was all C++ and desktop Windows PCs using OpenGL or DirectX (or even better Irrlicht). Now, I wanted to focus on Android devices so Java and OpenGL ES were the obvious choice. To get my head back in the game (so to speak) I knocked up a simple invaders clone. The aim being to familiarise myself with OpenGL, user input options, and the performance capabilities of the devices.

I was using OpenGL ES 1.1 (fixed pipeline) and producing the meshes in code.

CubeIcosahedronSphere Approximation

Cube, Icosahedron, and sphere approximation. The Sphere is approximated by subdividing the faces of an Icosahedron and pushing out the new vertices to lie on the sphere surface. From these basic meshes we can construct some simple game objects.

Alien ShipArtillery

The scene graph makes use of transform matrices to position, scale and rotate the meshes relative to the parent node.


Each game object has a global transform applied to it, and this also applies to the bounding sphere which is used for collision detection.


The user is able to move the artillery and fire on the alien ships. When a collision is detected the ship and shell are destroyed and removed from the field of play.

This is a relatively simple scenario, and the processing capability of the mobile device should be more than sufficient to handle it. However, I noticed some slow down in the frame rate when firing (and running collision detection). The slowdown wasn’t in the physics, or the collision algorithms, but actually in the Garbage Collector being called when Collections were being modified. In the past when I’d used C++ this wasn’t an issue, memory management is handled by the user. But with Java, the Garbage Collector is an automatic process. On searching for more information about this I stumbled on this presentation by Kactus Games that gave some great insights into Android Game Development.

On further research I stumbled on an excellent framework that takes the limitations of Java into account to allow developers to create games that will run not only on Android devices, but also on the desktop, in HTML5 browsers, and on iOS devices. LibGDX is definitely worth a look. The documentation, tutorials and example code are extensive and comprehensive. I’m now going back to the start to build a quick test game using this framework prior to experimenting with some novel ideas I have for a new game.