Developping Blackberry Applications

Few months ago, I got myself a Blackberry Storm. It is a neat little device whose main fault is essentially the fact that it is not an iPhone. It’s essentially a hybrid. On one hand it tries to be more of a fun consumer phone rather than a dull business device and so it eschews some typical Blackberry traits. On the other hand, it is still very much set in the Blackberry way of doing things. So basically the touch screen replaces the keyboard and the track ball, and the main interface is tweaked a bit to be touch friendly but that’s all. In the end result is somewhere in between a traditional blackberry, and a failed iPhone wannabe. Which means that both the people who like the classic Blackberry, and the people who were expecting an iPhone killer are disappointed with the device.

Me, I knew what I was buying ahead of time an I like it. I don’t know, the phone has a certain quirky charm to it, and so far I have been enjoying using it.

So I’ve been a Blackberry user for few months now, and I recently decided that I’m just about done with that end-user bullshit. I mean, I have this device, right? And it has an application building framework and an API out there. I’m a smart guy, so I should be able to figure out how to build apps for this damn thing, no? I mean, how hard can it be?

The answer is, not hard at all. In fact, it’s right up my alley. The Blackberry app development is done in… Tatadada! Java!

Well, fuck me in my sock drawer! That’s right up my alley. Java is my bread and butter ladies and gentlemen. It’s ugly as hell, verbose like a motherfucker, but God damn, I love it!

Not only that – the Blackberry JDE is available as an Eclipse plugin. You know eclipse, right? That’s the IDE that Steve Yegge makes fun all the time. The one that takes 3.5 hours to open up, right? Say what you want about it, but I like it. Yes, me – the Vi guy.

Let me put it this way – writing code in Java is like… Well, like me writing this blog. It’s verbose to the extreme. Every little tiny thing takes 5-6 lines of code. Eclipse will actually writhe half of these for you. And it has kick-as refactoring features which allows you to rename classes and methods at a whim, and see the changes ripple through all the files that reference them. In other words, it helps and makes Java less painful than it usually is.

Btw, did I mention that I am a long time Java developer? I talk trash about it, but only out of love.

So, what does it take to be a Blackberry developer? First you must obtain an outdated version of Eclipse. Yeah, the obsolete one. If you get Galileo the Blackberry JDE plugin will totally hose your installation. Yeah, it will positively demolish, cause it to bug out at start-up and won’t allow you to type anything. There is no un-install feature either, so just don’t install it in your “good” Eclipse folder.

Instead, get a copy of the Ganymede release and unzip it in it’s own folder.

Next, go grab the JDE Plugin. It’s an executable installation package, and it will ask you where is your root eclipse folder. You will then need to point it at your Ganymede directory and let it do it’s thing.

Once it installs, you will see additional menu options, bells and whistles. Quickly pull down the Blackberry menu, would you kindly, and check the “Installed Components” section. As you can see you currently have Blackberry JDE Component Package 4.5.0 in there and nothing else. What you want to have is 4.7.0.

Installed Components (you want 4.7.0)

Installed Components (you want 4.7.0)

Why? Because 4.5.0 is old, that’s why. Ok, you know how I opened this post talking about Blackberry Storm? That’s the one I have, right? So that’s the model I want to emulate when I test my applications. Not some piece of shit curve or world or whatever. So if you want to have the Storm emulator, you need 4.7.0. Or, you know – if you have a different device then you should get the appropriate one. Whatever. The point is, they are all backwards compatible, and you can install bunch of them, and switch them at any time. But it’s a good idea to debug your app in the device you are familiar with.

So, how do you get the 4.7.0 component? Easy – you use the Ecplipse Software Update feature located under the Help menu. Yeah, I know. I don’t get why they put it there either. Help is for manuals, but whatever.

Go to Software Updates, switch to Available Software and click Add Site. Then copy and paste this URL into the box:

Once it is there, you will be able to see Blackberry Update Site on your list like this:

Blackberry Update Site

Blackberry Update Site

Just drill down, pick 4.7.0 and install it. It may take a while of course. I think the whole package is a little over 100MB so be patient. Once it is done, you will be able to go back to Installed Components and pick it from the list.

When you compile and run your application you will then see this nice little emulator pop up:

The Blackberry Emulator

The Blackberry Emulator

Neat, eh? There is one catch however (there always is, no?). If you happen to be running Vista 64 bit like me, the emulator won’t close. Oh, it will stop working and freeze up but it won’t actually shut down. The only way to switch it off, is to kill it’s process via task manager. Or rather, Process Explorer because the Windows task manager won’t be much help when you don’t know the actual name of the process to kill. It’s fledge.exe btw. I’ll spare you the guessing game.

Actually, after doing this for a while I actually created a little batch script and put it in my quick launch toolbar for closing the damn thing:

taskkill /im fledge.exe

It works fine that way. Annoying and backwards, but it works. And that’s all that matters.

Oh, and the API is here. The docs are fairly clear, though little light on examples. I was able to work with it so far. It’s really not much different from building Swing applications – you’re just using different graphical toolkit here. Stuff like listeners and events works exactly the same.

There is some standard boilerplate code you do have to include in your apps, but it’s actually less than I expected. Next week I’ll show you how to do a simple Hello World app on the blackberry.

This entry was posted in Uncategorized. Bookmark the permalink.

2 Responses to Developping Blackberry Applications

  1. Steve UNITED STATES Mozilla Firefox Windows says:

    Thanks for mentioning Ganymede. I was trying to run the JDE with Galileo and it did not work at all. Eclipse gives all sorts of useless exceptions. Finally got it running. I haven’t written Java for about 8 years. This should be fun.

    Nice post.

    Reply  |  Quote
  2. I switched back from the storm to my old iphone after about a month. As much as I hate to say it, the iPhone, even with its limitations, is still more productive than the blackberry products.

    Reply  |  Quote

Leave a Reply

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