Persistent Storage


For some applications, you might need objects to exist even after the application that created those objects quits.
Persistent (non-volatile) storage is a storage device whose contents are preserved when its power is off.
Without persistent storage, objects and their states are destroyed when an application closes. If you save objects to persistent storage, their lifetime is longer than the program that created them, and later you can read their state and continue to work with them.

The MIDP Record Management System (RMS) is a persistent storage for MIDlets. It is a simple record-oriented database, which consists of a collection of records. Record stores (binary files) are platform-dependent because they are created in platform-dependent locations. MIDlets within a single application (a MIDlet suite) can create multiple record stores with different names. The RMS APIs provide the following functionality:
Record Store Names
Record store names are case sensitive, and cannot be more than 32 characters long. Also, a MIDlet cannot create two record stores with the same name in the same application, but it can create a record store with the same name as a MIDlet in another application. When you create a new record store, it is stored under a directory called appdb. For example, assume you are using the Wireless Toolkit and that it is is installed under C:\WTK23. If your record store is preferences, the record store is located at C:\WTK23\appdb\ DefaultColorPhone\run_by_class_storage_preferences.db .