Home > Articles > Programming > Java

Persistent Data and the Record Management System (RMS)

  • Print
  • + Share This
Article three in a four-part series on Java 2 Micro Edition (J2ME) development explores data storage on Java devices using the J2ME record Management System (RMS).

As I mentioned in previous articles, MIDP provides support for persistent data storage on mobile devices, and the MID profile specifies that compliant mobile devices must provide at least 8KB of non-dynamic memory for data storage purposes. In reality, most MIDP Java devices supply much more than this. This allows a midlet to take advantage of persistent data for applications. For developers with Java 2 Standard Edition experience, I should note that this data storage capability differs from Standard Java's serialization capabilities. The J2ME Record Management System (RMS) allows streams of data to be stored and accessed on a record-by-record basis. It's up to the application developer to parse each record down to the field level. Interfaces within the RMS package support comparison and retrieval functionality on an application-defined basis.

The javax.microedition.rms Package

J2ME's Record Management System is accessed via the javax.microedition.rms package. This package contains one class, RecordStore, and several useful interfaces (described in the following table):




An interface defining a comparator that compares two records (in an implementation-defined manner) to see whether they match or what their relative sort order is.


An interface representing a bi-directional record store record enumerator.


An interface defining a filter that examines a record to see whether it matches (based on an application-defined criteria).


A listener interface for receiving record changed/added/deleted events from a record store.

These interfaces are useful for implementing custom search-and-retrieval functionality. The interface that's used most often is RecordEnumeration. This interface is returned from the RecordStore.enumerateRecords() method call and is used to traverse a set of records returned from the record store. It includes methods such as nextRecord(), previousRecord(), numRecords(), and hasNextElement().

  • + Share This
  • 🔖 Save To Your Account

Related Resources

There are currently no related titles. Please check back later.