http://www.developer.com/

Back to article

Getting Started with the BlackBerry Mobile Development Platform


July 23, 2010

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.

BlackBerry Devices

All BlackBerry devices are smartphones, which means that they offer a network connection, a relatively powerful processor, and a decent keyboard. However, individual devices can vary greatly. There are dozens of BlackBerry device models, and keeping track of their individual features can feel like a chore.

Fortunately, RIM uses a fairly standard numbering convention to describe its devices. Most have model numbers with four digits, such as the 8320 or the 9530. The first two digits are a series number that describes the physical look of the device. The 8300, 8310, and 8320 will all have the same keyboard and the same screen resolution, for example. The final two digits are a model number that describes the radio capabilities of a device. The 8300 and 8800 are both GSM devices; the 8110 and 8310 are GSM devices with GPS receivers; 8320 and 8820 are both GSM devices with WiFi; and so on.

BlackBerry devices have traditionally featured full QWERTY keyboards, and most still do. The Pearl line of phones use a variant keyboard called SureType that acts like a cross between QWERTY and a multitap phone keyboard. The Storm series of touch-screen phones use a virtual onscreen keyboard. Most non-touch devices use a trackball, and some recent devices offer a trackpad.

All recent devices feature microphones and removable memory cards for expanded storage. Some devices may include features like cameras, accelerometers, and Bluetooth, while others lack them. If your application requires particular hardware support, you should first verify which BlackBerry devices offer your required features. No BlackBerry devices currently offer a compass, although they do provide ways to derive the user's bearings from recent GPS readings.

BlackBerry Development Costs

The price of BlackBerry development has dropped in recent years. You no longer need to spend anything to access the SDK and simulators, and you can complete most of your development without an actual device.

After you build your BlackBerry application, you should sign it. Signing allows you to access restricted APIs on the device, and it also prevents the user from seeing annoying pop-ups when running your app. At the time of writing, signing keys cost $20 and you must wait several days for RIM to deliver them. When you have your keys, you can sign as many applications as you want to as frequently as you like.

In terms of distributing your app, there is no charge for doing it yourself. If you wish to sell through RIM's BlackBerry App World, you will need to pay $200 to establish your account, which will allow you to submit up to 10 applications. Application updates and re-submissions count against your limit, and after you reach 10, you must pay another $200 to submit another 10 applications, and so on.

RIM hosts the BlackBerry Alliance Program for Independent Software Vendors. While joining the alliance program is not required for development, this program does offer support that may be helpful for companies starting out on the BlackBerry platform. Annual membership fees range from $2000 to $5000, with the higher levels offering more marketing support and earlier access to pre-release devices.

Conclusion

This concludes our look at how to get started with BlackBerry development. The next and final installment will examine resources for completing your app development and information on how to distribute and market your apps.

Chris King is a senior software engineer at Gravity Mobile. He is the author of "Advanced BlackBerry Development" and a co-author of "Unlocking Android, Second Edition." When he isn't programming or writing for fun or profit, Chris can be found reading, baking, cycling, or hiking throughout the San Francisco Bay Area.

Sitemap | Contact Us

Thanks for your registration, follow us on our social networks to keep up-to-date