Category Archives: Programming

Posts about programming

Cross-platform conundrum

A conundrum I’m having at the moment is that I have a vaporware home-time project which I’ve done a fair bit of design and research for. It’s really getting to the time that I should be writing some code, but I have a conundrum.

You see, this app has a very niche target user base of my (non-techy) friends. That means I need to write something which can be used on Windows, Mac OS X and Linux, whilst writing close to zero platform code (particularly for Windows, done that – not going back), and with minimal effort wasted (remember, home-time project).

First obvious choice is a web app, however after writing Blunderground I have some experience using JavaScript to develop an application and it’s not for meĀ (give me a compiled language any day of the week). Plus, I’d need some server-side pieces and then a server to host them on. I don’t have, nor do I want, a server to administrate.

Next we have Mono. While I like C# I’m put off by the ugliness of Gtk# on Mac OS X (and to a lesser extent, Windows). Of course, I can write a Mono core with native UI wrappers, but I don’t really want to maintain 3 separate UI code bases (or write host-specific code).

Third there’s that old faithful Java. The reason I won’t use it is simple, this is a GUI app and I hate Swing.

In four, there’s Clutter (and Mx) – brilliant. Only the non-Linux back-ends for Clutter will no doubt need some love, and for Mx are non-existent. Still… we could have a winner? I’m not very familiar with Clutter and I’m nervous how it would work out for what will basically be an IM client with a non-standard UI.

Finally, and by no means least, there’s Qt. The disadvantages to Qt are that I’d have to learn it’s intricacies (signals, slots, moc, etc) and obviously (as for Clutter) I’d need a host for each target OS to build the project on. That and using Qt would probably get me a flogging in the office.

Lots of choices, no simple answer. Bonus points if the platform has a decent XMPP library.

I guess that means fix and use Clutter/Mx, or write Qt and get flogged?

Find nearest tube station

When I first released Blunderground I put together a ToDo in the README of cool features I could implement if I get some time, one of which read: “Zoom to nearest station (get location from OSM)”.

Well, Neil recently got a Pre and decided that a good way to learn the WebOS API’s etc would be to contribute to Blunderground, and contribute he did – with an awesome patch to implement a “Jump to Nearest” button!

This adds a huge data file to Blunderground (> 1000 lines) that includes all the required data to find which tube station is nearest to the devices current GPS location and then zoom the map to that station.

I then decided to steal some glory from Neil by converting the main map to be a HTML canvas (rather than an img tag) and adding some slight bling for his feature:

The overlay will dissapear after 10 seconds, which could probably be handled in a nicer way…


Recently I wrote about doing some hacking for the Palm WebOS to create a tube app for K. It’s now in a reasonably usable form so I’ve put up a noddy website and a clone of my repository is available on GitHub.

As it’s at a stage where it works for the person I wrote it for (and a bonus user) it’s unlikely to be developed with any sort of pace, too many other fun things to hack on!

I’ve decided against trying to get it in to Palms app store as I’m fairly certain TFL won’t be too happy with me redistributing their map. There are ways around this but I don’t feel it’s worth it at this time, at the very least I’d need to support rotation and likely a couple of other features before submitting it to the app store otherwise Blunderground will just be a target for flames.

Writing apps for the Web OS is really easy, it’s just HTML and Javascript. I kept falling over the lack of static typing and my ability to create a large typo to LOC ratio but not everyone uses the compiler as a crutch like I do.

The develop/deploy/test cycle, even with the emulator, is a touch clunky. Seems to me a lot of the testing could have been done in a browser with a suitable harness but I didn’t have the inclination to develop that, I shall check out Ares if I write another WebOS application.

Finally interacting with web services wasn’t as rosy as the cloud pushers would have me believe, a significant bulk of the development time so far was spent on trying to figure out how to parse the JSON data TubeUpdates was returning. In the end I gave up and switched to using XML which I manipulated with JavaScript DOM methods and had the functionality running in minutes.