Login

Comparing RIM and JAVA ME APIs

When you’re first starting off as a BlackBerry developer you’ve got quite a few decisions to make. One of the most pressing will probably be which application programming interface — or API — you choose. Simply put, an API is a set of routines, data structures, object classes, and/or protocols that are provided by libraries or operating system services. So much importance is placed on choosing the right API because essentially, it will serve as your foundation and it will support the building of all of your BlackBerry applications. Let’s find out more about APIs and find out the specifics on both the RIM and JAVA ME API.

How APIs Work

An API can either be language dependent or language independent. In order to make the API as convenient as possible, language dependent APIs are only available in a particular programming language and only use specific syntax and elements of the programming language. Language independent APIs, on the other hand, are written in a way that makes them accessible in several different programming languages. Typically language independent APIs are a desired feature for a service-style API that will not be bound to a particular process or system. They are also usually available as a remote procedure call.

An API itself is pretty abstract in the way that it specifies an interface and controls the behavior of the objects specified in that interface. The software that provides the functionality described by an API is said to be an implementation of the API. Also, keep in mind that an API is usually defined in terms of the programming language that was used to build the application. The related term, ABI (Application Binary Interface), is a lower level definition concerning details at the Assembly language level.

BlackBerry API (RIM API)

The mobile phone industry is constantly redefining itself with more features and computing power, and no one knows this better than Research in Motion, which is the maker of the ever-popular BlackBerry. RIM also knows that the API is the heart of the development platform, which is why the company is allowing third-party developers to create new applications for their devices using their API.

Essentially, the RIM API is a collection of classes that allows you to provide effective security for your customized BlackBerry application regardless of its scope or complexity. The API is very robust and flexible so that you can accomplish each task in a number of different ways, depending on the needs of your application. These RIM classes have been added to the BlackBerry Java Development Environment, which has since been downloaded by over 125,000 developers. RIM is also planning to release additional APIs, for messaging and 3D graphics, in the near future.

Using the RIM API you can encrypt and decrypt data, and digitally sign and verify data, which also allows you to secure the integrity of your data. You can authenticate data as well. This is pretty standard for an API, but because it’s created by the same company for which you’re going to develop apps, you should run into few problems. As mentioned previously, the RIM API consists of several different components.

The Key Management API contains the basic cryptographic framework needed to create secure applications. Key management and distribution are handled by the KeyStore API, while keys are encoded using the Encoding API. The Certificate API contains the functionality necessary for managing cryptographic certificates. The OID (Object Identifier) API contains the functionality necessary for handling and using some popular Object IDs. The ASN.1 (Abstract Syntax Notation) API provides a mechanism to format and parse data that is commonly needed with cryptographic schemes and protocols.

At the lowest level, the Cryptographic Primitives API contains the most basic tools needed to implement the cryptographic utilities. This API contains the keys, MACS (Message Authentication Codes), ciphers and other functionality associated with both symmetric and public cryptography. In addition, this API contains the "unkeyed" algorithms such as digests and PRNGs (Pseudo Random Number Generators) needed by other members in the API.

It seems as if the RIP API was made specifically to target security, so if you’re a developer who is trying to incorporate security into their applications, the RIM API is for you. You don’t even need to have a working knowledge of security concepts or low level programming, as the API assists with all of this. The RIM API can also be used to provide security for any project, no matter the size or complexity. When incorporating the various levels of granularity into the API, the system becomes extremely customizable and extremely flexible.

In addition to its unique security benefits, there are many other APIs that should be of interest to the developer as well, including the ability to integrate with native BlackBerry applications, available UI elements that successfully replicate the look and feel of other BlackBerry applications, Messaging APIs, and much more.

{mospagebreak title=JAVA ME (Micro Edition)}

The RIM API works so well for BlackBerry apps because it was created by the maker of BlackBerry. Java Platform, Micro Edition (Java ME) on the other hand, provides a flexible environment for applications running on not only mobile devices like BlackBerry’s, but for other embedded devices such as personal digital assistants (PDAs), TV set-top boxes, and printers. Java ME includes flexible user interfaces, robust security, built-in network protocols, and support for networked and offline applications that can be downloaded dynamically. Applications based on Java ME are portable across many devices, yet leverage each device’s native capabilities.

Originally, Java ME technology was created in order to deal with the constraints associated with building applications for small devices. For this purpose, Sun defined the basics for Java ME technology to fit such a limited environment and make it possible to create Java applications running on small devices with limited memory, display and power capacity. BlackBerry developers will find that there are slight similarities between the JAVA ME and the RIM API. As mentioned previously, the RIM API is a collection of classes, while the Java ME platform is a collection of technologies and specifications that can be combined to construct a complete Java runtime environment tailored to fit the requirements of a particular device or market. This offers BlackBerry developers a flexibility and co-existence to seamlessly offer the most appealing experience for the end-user.

The Java ME technology is based on three elements: a configuration provides the most basic set of libraries and virtual machine capabilities for a broad range of devices, a profile is a set of APIs that support a narrower range of devices, and an optional package is a set of technology-specific APIs. The configuration targeting resource-constraint devices, like BlackBerry’s, is called the Connected Limited Device Configuration (CLDC). It is specifically designed to meet the needs for a Java platform to run on devices with limited memory, processing power, and graphical capabilities.

On top of the different configurations, the Java ME platform also specifies a number of profiles defining a set of higher-level APIs that further define the application. A widely adopted example is to combine the CLDC with the Mobile Information Device Profile (MIDP) to provide a complete Java application environment for smartphones such as BlackBerry’s and other devices with similar capabilities.

It’s impossible to say which API is better: RIM or JAVA ME. Instead, fledgling BlackBerry developers should first decide what kind of apps they intend to create and then choose their API according to their needs and the needs of their applications. It’s important for developers to also consider who their target market is. Do they want to write one application that works across multiple smartphones, phones, etc. or do they want to customize their application to BB to provide a better experience for the user? Keep in mind that the latter requires more development time.

You should also consider your target audience; do you want to create one application that works across multiple smartphones, or would you rather customize your application to BlackBerry, giving your user a better experience? While developing a customized BlackBerry app may take longer, in the long run it will be more similar to native BlackBerry applications, and more comfortable for the user.

One thing is for sure, though: no matter which you choose, both APIs have a lot to offer in the way of security. Both APIs have much to offer, but I think the main idea to focus on is that if developers use the BB API, you will end up with a much more customized application, similar to other native BB apps (meaning the other apps on the device that are written by RIM) and a better experience. Of course, this may or may not make the decision of which API to choose more difficult.