Interacting with BlackBerry’s PIM Data - Smartphone Development
It seems as if everyone uses a BlackBerry these days. But not everyone organizes their information in quite the same way. If you're going to build the programs that help people stay organized with BlackBerry devices, you need to understand the kinds of data types that users acquire, organize, and use to get through the day.
As a developer, knowing how to interact with a BlackBerry’s PIM data is important because at its core, BlackBerry is all about managing personal information. Essentially, PIM data is primarily used by three already-existing applications on a BlackBerry smartphone: the calendar application, address book, and tasks application. It is with these apps that data is entered, stored, retrieved, and manipulated.
As an example, let’s discuss the event data class in detail. This feature enables BlackBerry users to set start and end times for an event, as well as create a reminder or mark the event as recurring. This is all easy enough for the user, but how can you as a developer interact with this PIM data programmatically?
It’s important to understand that when working with BlackBerry APIs for PIM data, there are two levels of classes you should take note of. The first is called javax.microedition.pim, which is a package containing generic PIM data. Also, the classes in this particular package are usually found on devices beyond the BlackBerry and represent the core PIMItems. The supported JSR-75 contains two optional packages for features found on PDAs and other J2ME mobile devices. The first allows you to access PIM data, and the other is used to access file systems.
The second class to take note of is the net.rim.blackberry.api.pdap, which is a package containing BlackBerry-specific extensions to the javax.microedition.pim classes. Also, keep in mind that the PIMItem is a generic PIM data element, which contains a collection of data fields. PIMItems can usually be organized into a PIMList, which act as a collection of PIMItems. The location supported by a specific platform may change, because it is always determined by the PIMList where the PIMItem is stored.
The data fields inside a PIMItem can come from a variety of different data types. Some of the most common are String, String Array, Date, boolean, integer, and last but not least, binary. Each of these PIMItem classes includes “getters” and “setters,” which are used to manipulate the data. Each and every field will include a descriptive label, zero or more data levels, data value attributes, and a specific data type. These field names are then even further categorized by integer values that will be determined by the contact, event, and to-do classes.