Getting Started with the BlackBerry Mobile Development Platform

BlackBerry devices do not fare well in the media battle, but they may win the market share war. While the iPhone and Android rule technology headlines, BlackBerry phones have thoroughly penetrated large corporations and recently expanded their reach to many consumers. Research In Motion (RIM) has worked hard to enable developers to create compelling applications for their phones, and you may be surprised to learn that these devices can do nearly everything their flashier competitors do, as well as some things they cannot.

This article will walk you through the essential facts of BlackBerry development. You'll learn enough to decide whether and how BlackBerry fits into your mobile product strategy, and be able to start preparing to write awesome BlackBerry apps.

Editor's Note: For complete reviews of all the leading mobile development platforms, see the Internet.com Special Report "Field Guide to the Mobile Development Platform Landscape".

BlackBerry Development Environments

The BlackBerry toolset has drastically improved in recent years. If you haven't touched the platform in a few years, you will be delighted at what it now offers.

The BlackBerry Java Development Environment (JDE), which combines an SDK, an IDE, and a set of simulators, has tortured developers for years. This Swing-based application gets the job done, but it employs a user interface that screams 1994, perplexing debugging, and inconsistent keyboard shortcuts. It does offer the advantage of a single download that contains all you need to develop and debug on the simulator and the device, but using it can be quite painful.

Each JDE version is tied to a particular version of the BlackBerry OS. So, for example, if you wish to target a device running OS 5.0, you would download JDE version 5.0. I will discuss versions more later in this article, but for now, be aware that all BlackBerry Java applications are forward-compatible. An application written using the 4.2 version of the JDE will run on a 5.0 device, but an application written on the 5.0 JDE may not run on a 4.2 device.

Because of the JDE's shortcomings, developers have often turned to their own preferred IDEs, such as NetBeans or IntelliJ IDEA. Because most BlackBerry applications are written in Java, you can use any Java editor to write your application code. However, other IDEs typically do not integrate well with debugging, and they require custom plugins or scripts to build and debug BlackBerry applications.

The BlackBerry landscape changed when RIM announced a custom plugin for Eclipse that combined the features of their custom JDE with the ease-of-use of Eclipse. The latest version of the BlackBerry Java Plugin runs on Eclipse 3.5 and has been embraced by developers. You can read instructions for installing the plugin at blackberry.com.

Finally, if you are primarily interested in developing visual content for the BlackBerry, such as wallpapers or videos, you should check out the BlackBerry Theme Studio (formerly known as the Plazmic Content Developer's Kit).

BlackBerry Simulators

Although you eventually should run your app on an actual BlackBerry device, you will likely perform the majority of your testing on a simulator. The simulator allows you to bypass several tedious loading and permissions steps, as well as simulate devices that you may not physically possess.

When you download the JDE or the JDE Plugin for Eclipse, it will install a basic set of simulators for you automatically. You can -- and should -- download and install additional simulators, which allow you to test the exact model, wireless carrier, and firmware version of your targets. As a bonus when you download a simulator, you will be able to perform on-device debugging for the corresponding device.

The BlackBerry simulators get mixed reviews, however. On a positive note, they tend to be very accurate. The behavior you see on the simulator will usually match what you would see on the device. On the downside, the simulators are painfully slow. To ensure their accuracy, they fully simulate every aspect of the device, including a very lengthy boot-up process. Depending on the speed of your development machine and the particular simulator you use, it easily can take several minutes to start debugging. Also, when you make any changes to your program, you will need to restart the entire process; the simulators do not support hot-swapping code.

BlackBerry Programming Languages

BlackBerry devices use a superset of the Java ME language, which itself is a subset of the Java language. If you have programmed in Java ME before, you will see that all the core Java ME features are available. BlackBerry devices also include many of the most popular JSRs, adding features such as file connections, media recording and playback, wireless messaging, and more.

If you have previously written Java on the desktop or the server, you may be disappointed with BlackBerry Java. Java ME is compatible with Java 1.3, and does not include many of the nicer features added to the language during the past decade, such as generics, enumerations, and regular expressions. It also lacks some features that were present in Java 1.3, such as collections and reflection.

RIM has enhanced the basic Java ME legacy of BlackBerry development with a very rich set of custom APIs. Many offer features specific to mobile devices, including information about cell towers, battery levels, and so on. They also include some very useful features that are in standard Java but not in Java ME. For example, while you won't find java.util.Arrays , there is a net.rim.device.api.util.Arrays class that offers most of the same features.

If you plan to develop Plazmic content for animation, you will ultimately be working with Scalable Vector Graphics (SVG). However, most of your work can be done directly within the BlackBerry Theme Studio. Alternately, the BlackBerry toolset offers some support for creating a Flash SWF file and importing it to BlackBerry. If you wish to go this route, make a prototype first to make sure you will be happy with the results of this conversion.

Like all modern mobile platforms, BlackBerry also supports web applications. All BlackBerry phones accept standard HTML as well as legacy WAP pages. The BlackBerry Browser offers JavaScript, although different devices have different levels of support.

The next big thing for BlackBerry will be widgets. BlackBerry Widgets are written using HTML, CSS, and JavaScript, and they provide lightweight applications that can be installed to the device. They can access an extensive JavaScript API for BlackBerry, and you can further enhance them by writing custom JavaScript libraries that access native Java APIs. If you learn to write web apps and Java, you will be in a great position to write BlackBerry Widgets.

Page 1 of 2