In the computing world, the hardware is often a step or two ahead of the software. The simple reason is that once the hardware is released, it takes time before software developers start creating applications for the new hardware.
Such is the case with BlackBerry. However, the latest versions of the Blackberry devices-including the Storm-now have an SDK (software development kit) that lets Java developers create software that takes advantage of all the great new features in the BlackBerry.
For example, the Storm has a lot of cool new features, including an accelerometer-a built-in motion sensing device that lets the Storm know what angle it’s being held at relative to the ground so that the screen can automatically rotate 90 degrees when you hold the Storm in your hand.
Additionally, the Storm features a full-size touch screen, unlike previous BlackBerry models that divided the front of the device between screen and keyboard, as well as other new features.
To accommodate these new features, Research In Motion, which manufactures the BlackBerry, has released a beta version of the new SDK, including programmatic support for the new features. In this article I’ll look at what’s available in the new SDK, including some new and some not-so-new features.
The motion-sensing devices seem to be all the craze these days, and I’m one person who has fallen for it, having recently bought a Nintendo Wii. Although mobile devices such as the Storm use a totally different technology from the Wii (the Wii uses infrared transmitters and software triangulation), as well as Apple’s iPhone (which has a patent), the end result is the same cool feeling that the device somehow knows where it is relative to the Planet Earth. (I tried to get information on how the one in the Storm works by searching the online U.S. Patent database. I quickly became frustrated after discovering that RIM has nearly 1,200 patent applications in process that haven’t yet been approved. However, I did locate a patent application that seems to describe it. If you’re curious, go here and search patent applications for publication number 20080034321.)
To accommodate the accelerometer, the SDK includes APIs for detecting both the orientation of the device (either the top is up, or the left side is up), and the acceleration of the device. By detecting the device’s orientation, your application can change its orientation between portrait and landscape accordingly. In addition, by sensing acceleration, your application can detect movement along all three coordinates in space.
The only stickler is that the application shouldn’t constantly poll the accelerometer. According to the documentation, the accelerometer takes a great deal of battery power, and shouldn’t be on constantly. This is because when an application opens a channel to the accelerometer device, the BlackBerry continuously polls the motion sensors. Therefore, your application should poll it periodically only as needed. (Although I suppose in the case of a game, a user would need to poll at a high rate to keep up with user movements. The key there is for the user to open a connection to the motion sensor, get the data, and immediately close the connection. Then on the next poll, do the same thing.)
Finally, the Storm has built-in capabilities to turn the screen sideways when the device moves. The application can query the current orientation, and even turn off this default behavior.
The APIs include support for the touchscreen. The device can detect when the user pushes on the touchscreen, when the user moves the finger across the touchscreen, and when the user lets go of the touchscreen. Additionally, the device can capture events for gestures, and even double-taps (the latter of which is missing on a lot of touchscreen devices).
What’s interesting about the Storm’s touchscreen is that not only can a user touch it like any other touchscreen, they can actually push on it, and the screen will click like a large button. When I first heard about this, I thought that was a little odd, but it actually has a great benefit in the way of not accidentally clicking when you don’t want to. The software in turn can respond to just touches as well as clicks of the screen. At a low level, a user can receive events for pushing a click on the screen, and letting go of a click on the screen.
The touchscreen includes a built-in on-screen keyboard that the application can also make use of. In addition to simply reading text from the keyboard, the application can control the keyboard itself. The application can determine if the keyboard is visible, and can also display or hide the keyboard.
Digital Rights Management
Another new feature is built in DRM (digital rights management) and the ability to access DRM data from an application. In the past, DRM was a touchy issue, because people didn’t like the idea of having limited rights (including copying) of the data on their computers. However, with mobile devices, DRM has become the norm, especially with mobile music. Still, corporations have a need for DRM, too, especially when devices might be carrying sensitive, private corporate data.
At press time, the information on what is available in terms of DRM for the new API is limited, so I’m limited on what I can report here. The API documentation says: “Applications can now install certificates on DRM protected content.” The API includes an interface called DRMRightsInstallCallback, a class called DRMManager, and an exception called DRMException. Hopefully we’ll find out more about this soon enough.
Although not everybody is aware of it, many mobile phones today have GPS devices built into them. However, most phones that have GPS don’t allow software applications to access data from the GPS. The BlackBerry Storm is an exception. A user can access the data from the GPS right from within the application.
The ability to access the GPS isn’t new with the latest version of the SDK. However, RIM has enhanced the access just a bit. Previously users could access the GPS information using a Location API. Now they can get information about the GPS hardware itself (such as whether the GPS detects if a satellite is in view, and even-believe it or not-if the GPS hardware is permanently dead).
The API documentation lists a whole set of interfaces and classes that have changed since the previous version. The documentation also lists in its overview several interesting changes. The overview mentions a nice change where an application can register itself as a “Send To” recipient that will appear in the popup menu when the user snaps a photo with the built-in camera. If a developer is creating an application that processes camera images, that can come in handy.
The API reference also includes updates to some of the GUI elements (such as TextBox and GameCanvas), allowing greater integration with the new touchscreen. The latter, GameCanvas, is updated through the new BlackBerryGameCanvas class, allowing developers to create games that can be controlled through the touchscreen, something that people who like games will likely appreciate.
This update is a minor version update, coming after version 4.6.0. As such, it’s not a huge update. Instead, it adds programmatic access to the new features that are available in the newer devices. These features focus primarily on the touchscreen and the accelerometer. To see the full list of changes to the API, click here.
Senior Editor Jeff Cogswell can be reached at [email protected]