Java Reference
In-Depth Information
the user) have access to handset data. Obtaining this trust is typically a matter of third-
party certification prior to distribution. While not perfect—of course, it's possible that
even a well-crafted application might have a defect that results in improper data access
despite passing certification tests—such a scenario is far less likely than in an
untrusted computing environment.
Typically, devices distributed by a network operator impose signing requirements for
a number of APIs, including file system (and PIM) access. The signing requirements are
often hierarchical, and for full access, you may need to distribute your application on the
network operator's deck, requiring a business arrangement between your firm and the
network operator. Consequently, even if a device supports these APIs, they may not be
commercially available to your users on some devices.
Wrapping Up
Although not available on every Java ME device, JSR 75 defines two packages for access-
ing existing data outside the Java sandbox. The FCOP, building atop the GCF, lets you
access and manage files on internal and removable file systems. You access files and
directories for reading and writing using the Connector class, and then use the resulting
FileConnection instance to open the file or perform directory-level actions such as creat-
ing new files or directories or removing existing files or directories. Using the
FileConnection , you can also obtain InputStream and OutputStream instances for your file,
letting you read and write data from files on the file system. You can also listen for
changes to the file system that notify your application when removable media is inserted
or removed, letting your application respond to file system change events.
The PIM package, also defined by JSR 75, provides a set of abstract interfaces that let
you access contact, event, and to-do databases. Using the PIM class, you access a single-
ton that then lets you open PIM databases—represented by the PIMList interface—and
enumerate native database records in each of these applications. The resulting records
are represented as PIMItem objects, which consist of fields you access by enumerated key
via getters and setters.
 
Search WWH ::




Custom Search