I must start off with a disclaimer: to build this widget I followed the instructions outlined in this document by Andre Fabris.
The biggest gotcha in the process is to make sure that you have your environment setup just right. RIM is encouraging developers to start using Eclipse IDE for all your BlackBerry development needs. So, if you never used Eclipse before and don’t have it installed, it will take a bit of downloading and a bit of effort to get your environment setup.
First of all, sadly enough, none of this works on a Mac. You’ll need Windows XP or Vista.
Next, you’ll need the Eclipse IDE, of course. You can get the latest version here (http://www.eclipse.org/downloads). You just need Eclipse Classic. The current version on the site is 3.5.1. The Widget instructions call for Eclipse 3.4.1. If you want to be on the safe side and follow the instructions, you can find previous versions here (http://download.eclipse.org/eclipse/downloads)
Once you have Eclipse downloaded and installed, you’ll need to add two additional pieces of software to it: Eclipse Modeling (EMF) 2.4.1 and Web Tools Platform (WTP) 3.0.3. Note, without WTP you won’t be able to follow the first step of the instructions, so make sure to install it.
The easiest way to add both components to Eclipse, is to go through Help – Install New Software inside of the IDE. Inside of the ‘Install New Software’ dialog box click on the Available Software Sites link. In the next dialog, scroll through the list of sites to find http://download.eclipse.org/modeling/emf/updates/releases/ and http://download.eclipse.org/webtools/updates locations. Enable them both.
In the ‘Available Software’ dialog select the EMF site from the ‘Work with’ list and then pick EMF 2.4.1 SDK from the list of available software. Click ‘Next’ and go through the prompts to install the software. Repeat the steps to install the WTP.
Install the rest of components as required by the instructions. When picking a simulator, choose one of the newer devices. Widget development requires BlackBerry device software 5.0 or above, so don’t pick a Pearl simulator and wonder why your widget is not working.
Go through the steps outlined in the document. When you get to the end and build your widget, your web folder contents will look a bit different than the document. I imagine that happens because of the newer version of the Widget Packager. In the bin folder you will have an OTAInstall folder, a StandardInstall folder and a JAR and an RAPC file. When selecting a Java program to load in the simulator, select the COD file from the OTAInstall folder.
When you load the program, nothing really happens in the simulator. Don’t expect your Widget to just start running. In the simulator, navigate to the Downloads folder on the device. The widget icon is in there. Click on the icon to run your widget.
That’s it! You will have just built and executed your first BlackBerry widget.
Now I just need some ideas for more widgets to build.