Getting started with BlackBerry development in Eclipse

After using the BlackBerry JDE plugin for Eclipse for the past couple of months (yes, a bit late on that – I was in a non-develoment job for most of the past year), I can say that – while not perfect – it is currently the best way to develop applications for BlackBerry.

And even with its flaws, RIM has finally delivered something approaching a world class BlackBerry development environment. So if you are thinking of dipping your toes in BlackBerry development, there has never been a better time.

I’ll describe setup in a bit, but first a bit of history:

A (very brief and abridged) history of BlackBerry development

The very first BlackBerry handhelds – the 95x and 85x devices – had to be programmed using C++.  RIM made the great choice of using Microsoft Visual Studio as their development environment, which although missing some features VS.NET has today, was still one of the best environments 7 years ago – and definitely (as today) one of the best debuggers around.

When the first Java based BlackBerry handhelds shipped (also the first to run on the mobile phone networks, so the first to function as phones), they shipped a home-grown IDE called the BlackBerry JDE (Java Development Environment).  To their credit, they had a great simulator, good debugger and a rich class library, but the editor itself left more than a little bit to be desired.  Given the availability even then of open-source 3rd party tools like Eclipse, there were constant requests for integration with something else.

With the release of the 4.1 JDE, RIM sort-of answered those requests.  They released a standalone simulator launcher which used JDWP, and so could be integrated with Eclipse (or NetBeans) and the availability of 3rd party BlackBerry Ant tasks meant that you could cobble together a reasonable development environment around Eclipse.  It wasn’t quite as seamless as the JDE, and much harder to setup, but the superiority of the Eclipse environment meant that a lot of developers (including myself) started using this kind of setup for BlackBerry development.  Most developers though – including some of the best BlackBerry developers that I know – continued using the JDE.

Finally in March of 2008, RIM released a plug-in for Eclipse that replicated all the functionality of the JDE in an easy-to-use package.   A lot of people haven’t looked back since. I’m one of them. So let’s get started.

Setting up the JDE Plug-in

As I implied, setup is very easy.
1. Get and install the JDK from Sun (but you probably already have that, right?)
2. Download and setup (i.e. unzip) Eclipse 3.4 (the regular Java version is fine for BlackBerry development)
3. Download one of the JDE plug-in packages from RIM’s BlackBerry Developer Zone (I recommend the one that includes all the JDE versions – at minimum you’ll want something that includes 4.3 to maintain compatibility with the largest installed base of devices, but probably also 4.7 so you can develop some touch-aware functionality for the sexy new touch-screen Storm)
4. Install the JDE plug-in.  Don’t worry about which workspace you use to install the plugin, it’ll always appear in every eclipse workspace once installed in on.  There’s a Word Doc on the BlackBerry site with instructions (Word?  Ah, RIM), but also a Google-docced version here

And you’re ready to go!

Your first BlackBerry project

This will be very quick, I’m focusing on the mechanics of project setup, and so won’t explain the code at all (look for lots of other posts about that!)

Creating the project

1. Create a new BlackBerry project (from the Eclipse menu choose File->New->Project)
2. Choose BlackBerry->BlackBerry Project
3. Click Next, and Name your new project (I called mine HelloWorldBB) and finish the new project wizard

What a basic project looks like

You’ll see a couple of things listed under your project.  One is a folder called src, this is the default name for Eclipse source directories.  The other is a link to a library called NET_RIM_BLACKBERRY.  This is the BlackBerry runtime library, which includes the all the Java ME classes.

Leave a Reply

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