Data handling

MIDlets may need to access and handle native application data, such as contact lists, sensor data, or files stored on the device. Java ME allows MIDlets to handle the following kinds of native data:

Persistent data

The javax.microedition.rms package of the MIDP 2.0 specification allows you to store persistent data, such as saved games and high-score tables, and later retrieve the data. The package does not enable writing or reading data outside the RMS.

Databases

To complement the javax.microedition.rms package, the PDA Optional Packages for the J2ME Platform (JSR-75) specification provides two optional APIs that allow MIDlets to create, read, and write files and directories in the device file system:

These two APIs are completely independent of each other, so devices can support either or both.

Central Repository

The Central Repository API allows to access the Symbian central repository in the Symbian platform. Using this API, the values stored in the central repository can be read from and written to.

Sensors

The Mobile Sensor API is an optional API that allows MIDlets to fetch data from the sensors of a mobile device.

Contactless targets

The Contactless Communication API is an optional API that allows MIDlets to use the Near Field Communication (NFC) capabilities of the device to communicate with contactless targets, such as other NFC devices or radio frequency identification (RFID) devices.

Developer's guides

The following developer's guides are available on data handling:

  • File access

    Describes how to use the FC API, and provides an example MIDlet for browsing and displaying images stored in the device file system.

  • Personal information management

    Describes how to use the PIM API, and provides an example MIDlet for creating and sharing events.

  • Mobile sensors

    Describes how to use the Mobile Sensor API, and provides example MIDlets for using sensors connections and navigating an image with the accelerometer sensor.

  • Contactless communication

    Describes how to use the Contactless Communication API, and provides example MIDlets for communicating with contactless targets.