I finally wrote my first BlackBerry (handheld) App

I spent a couple days over the last couple weeks working on a BlackBerry WebWorks application. The BlackBerry WebWorks API is basically a HTML/JavaScript application compiled into a Java application for use on the handheld. It has access to a fairly large set of the RIM APIs in the device and as I am not interested in learning Java, is about the only option I have.

As a primarily hobbiest developer I found the process to be fairly straightforward, though unfortunatly extremely Windows-centric. The primary debug workflow involves Eclipse and the BlackBerry device simulators, the latter being Windows-only. Trying to debug without the sim is a non-starter as the JavaScript engine will not throw any useful error messages while running live on a device. It is not wholly awful but I really do prefer avoiding Windows if I can reasonably manage it.

There are obvious Enterprise edges sticking out through the process though happily the new, fluffy, comsumer oriented image that RIM is putting on has really improved the developer start up process. Code signing keys no longer cost money, and getting them is basically a process of signing up in a web form and waiting a few days for the files to be delivered to your Inbox.

I ended up writing a small application that takes some of the backend data that powers my personal Status Board (similar to the Panic Status Board) and displays it on the phone along with some other useful data that I can get out of the RIM APIs.

screenshot

I originally was just using jQuery to fetch the JSON from my status board but was somewhat unsatisfied by the performance of pulling the data over the macro network and loading it into the page every time the application loaded so I replaced that with an on-device cache and push update system that takes advantage of the BlackBerry Enterprise Server I have (RIM offers a free push service over BIS as well but I like the idea of using the BES’s encrypted transport) hosting my e-mail.

The push server side of the equation is somewhat poorly documented, mostly through snippits of Java and .NET code that other people have implemented and some PDFs from RIM describing the format. After some trial and error I was able to pull together a workable Python update script that fetches the JSON from my status board and pushes it to the handheld. This allows fast, bandwidth friendly, scheduled, asynchronous updates and improves the user experience quite a bit. I totally understand why RIM is pimping their push infrastructure as being a vital part of what they are calling “Super Apps”. Having the data come to the user versus making them constantly update it is kinda awesome.

I doubt this application will be useful for anyone else but in the odd case that it might be the code is available in my bzr repository, which you can view at: http://repo.ub3rgeek.net/branches/blackberry/files, the status-app directory contains the handheld application source and the push-server/status-push.py file contains the push application.

Tags: ,

Leave a Reply

XHTML: You can use these tags:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

ub[3]rgeek.net is Digg proof thanks to caching by WP Super Cache