My first BlackBerry Widget

I must start off with a disclaimer: to build this widget I followed the instructions outlined in this document by Andre Fabris.

BlackBerry Widgets are standalone BlackBerry applications that are built like a web page.  They consist of HTML, CSS and JavaScript.  So they don’t require a whole lot of BlackBerry-specific knowledge to build.  The very cool thing about them is that, while they appear to be a simple web application, through JavaScript they have access to the device itself.

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.

About these ads

6 Responses

  1. Congratulations!

    And welcome to the club! :-)

  2. [...] The rest is here: My prototypal BlackBerry Widget « Alex Kassabov [...]

  3. [...] here to read the rest:  My first BlackBerry Widget « Alex Kassabov By admin | category: bb | tags: css, html, very-cool, widgets | BlackBerry Curve 8530: [...]

  4. [...] reading here: My first BlackBerry Widget « Alex Kassabov Share and [...]

  5. Thanks for this, it seems simple, but these setup instructions really helped!

  6. I am not able to download the document can u please share other link if u have
    Regards

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.

Join 529 other followers

%d bloggers like this: