How To: Setup Eclipse for BlackBerry Storm Development

I’ve spent many hours trying to install BlackBerry plug-in v4.7 (needed to develop for Storm) on Eclipse and finally I found solution. As always solution was in one small detail. Here is the whole process to setup environment.

Install J2SE

Download and install Java SE Development Kit. Personally I used JDK, but I think JRE should work as well.

Install Eclipse

Download and install (actually unpack) Eclipse IDE for Java Developers if you don’t have one. I must say that BlackBerry plug-in for Eclipse contains this IDE, but who knows what version did they pack into plug-in installer.

Download Complete Eclipse Software Update

Once you checked that your Eclipse is working you need to install BlackBerry Eclipse plug-in. Go to BlackBerry JDE Plug-in for Eclipse and download Full Installer and Eclipse Software Update for the BlackBerry JDE v4.7 Component Pack.

Install Eclipse Blackberry Plugin

Install plug-in from Full Installer first. It will ask you to install new Eclipse or specify existing one. Just point to your Eclipse folder and proceed installation process.

Since Full Installer does not provide you with Storm emulator and v4.7 platform you need to install v4.7 Component Pack. RIM web site suggests to install this update using update site. Don’t do it. If you already tried to go this as discribed in instructions you will need to perform step 4 in the list placed below. Here is correct way to install update:

  1. Run Eclipse
  2. Go to Help > Software_Updates
  3. Switch to Available_Software tab
  4. Make sure that you don’t have a link to “http://www.blackberry.com/go/eclipseUpdate” there. If you have follow step below otherwise jump to step 5.
    • Remove link to RIM update site using Manage_Sites button.
  5. Add new site like this:
    • Click Add_Site button.
    • Click Archive button and select update file downloaded earlier.
    • Click OK.
  6. Check this new node in the list of available software and click Install button.
  7. Follow instructions in installer.

Setup Eclipse To Use Blackberry 4.7 JDK

Now you will have 4.7 installed, but not set as default. You need to change default component from 4.5 to 4.7. To do so you need to:

  • Create new workspace and add BlackBerry project (File > New > Project and pick BlackBerry project).
  • Go to BlackBerry > Configure_BlackBerry_Workspace in Eclipse main menu.
  • Navigate to BlackBerry_JDE > Installed_Components
  • And change component from 4.5 to 4.7

That’s it. Now you can start playing with Eclipse environment for BlackBerry.

P.S.
There are some problems with simulator under Eclipse. I wrote about this in BlackBerry simulator in Eclipse could work better.

There is No “enum” Keyword for BlackBerry

In one of projects I’m working on I needed to port some code from Android to BlackBerry platform. As part of implementation for Android I used enumeration.

As I saw there is no “enum” keyword for BlackBerry. That was hard to understand since I like enums as a natural way to group constants. Anyway I had two options: use simple constants or design a class. I decided on the second one.

So for enum that looks like this:

enum Numers {
	Odd, Twin;

	public int toInt() {
		return (this == Odd) ? 0 : 1;
	}
	public static Numbers fromInt(int value) {
		return (value == 0) ? Odd : Twin;
	}
}

I used class like this:

class Numbers {
	public static Numbers Odd = new Numbers(0);
	public static Numbers Twin = new Numbers(1);

	private int _value;

	private Numbers(int value) {
		_value = value;
	}

	public int toInt() {
		return this._value;
	}
	public static Numbers fromInt(int value) {
		return (value == 0) ? Odd : Twin;
	}
}

Not so natural as with “enum” keyword, but good enough :)

 

BlackBerry Simulator in Eclipse Could Work Better

Yesterday I finally installed BlackBerry plug-in for Eclipse, but I’m disappointed by simulator integration with IDE.

For some reason BlackBerry simulator does not do it’s best when developing using Eclipse. Most of the time I cannot run application twice from Eclipse. I have to restart simulator for second attempt to run my app.

It takes some time. So I found a faster workaround. When I see this kind of problem I:

  • rebuild project (Alt+B)
  • manually delete application from simulator (Select app in Downloads; Menu > Delete; Click Delete to confirm)
  • manually load application to simulator (File > Load_Java_Program from simulator menu)

This is much faster then restarting simulator every time problem occurs.

Unfortunately this works only when I don’t need to debug code. I still have to restart simulator when debugging.

BlackBerry vs Android as Development Platforms

Next project I’ll be working on will be for cell phones. I’m not sure about the platform (we’re thinking of BlackBerry or Android).

So last four days I spent checking out their SDKs. I’d like to share my impression of them.

Let me break it into several steps I went through.

Web site
Android site looks positive and leaves a feeling of openness.

BlackBerry web site looks more like a part of business and does not provide positive emotions. On the same time I felt like these guys from RIM didn’t finish their job. I don’t complain about the need to register (that’s not a big deal), but forms for registration and downloading are like unfinished paintings. Looks fine, but doesn’t feel good.

And a few words about the content. I think that content is pretty good on both sites. Probably it is better structured on Android site. Special thanks to BlackBerry for videos: it’s faster than reading and it inspires to eat it all (when I read sometimes I skip parts to come back in minute which is not productive, but it’s a habit I’m fighting with).

Installation
Android is a winner here. No issues at all, just followed instructions on web site.

Installing BlackBerry took much more time. And I must confess that I couldn’t install Eclipse plug-in at first. After fighting for an hour (half of which took the download itself) I quit. That was after I installed and tried BlackBerry JDE otherwise I would proceed fighting with installer. Installing BlackBerry JDE did not bring much problem thanks to a tip with PATH variable (http://moazzam-khan.com/blog/?p=52).

Later on I was so unsatisfied by BlackBerry JDE that spend as much time as it required to figure out how to use Eclipse for BlackBerry development. You can find my post about setting up Eclipse here.

Playing with development
Two main points here are: I liked Eclipse more then BlackBerry JDE and there is Eclipse supports drag&drop designer to create forms for Android.

Second one is a big plus because it allows to not digging into xml used to present forms for Android. Also looks like there is more standard GUI controls for Android.

In general working with Android brings a bit more pleasure.

Running/debugging and Emulator
When working with Android all you need to do is run your code from Eclipse and it will automatically started on emulator.

With BlackBerry the story is not so clear. After running application from BlackBerry JDE you need to manually go to Downloads menu item in emulator and run app there. After this JDE will hook up application and debug will be available.

Also I’d like to say that I had to create AVD (Android Virtual Device) for SDK version 1.5 because after installing SDK 1.5 I had emulator only for version 1.1. It was pretty simple following instructions from Android developers site.

Documentation
Both SDKs have good documentation. Android has clearer documentation and because it is on developers site it leaves a better feeling.

So my opinion is that developing for Android should bring more positive emotions to the life.

I’m Tweeting

Follow

Get every new post delivered to your Inbox.