O'Reilly logo

J2ME in a Nutshell by Kim Topley

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Name

RecordStore

Synopsis

A RecordStore provides persistent storage for a collection of records. The means by which the records are stored is device-dependent. A RecordStore may be implemented using a native feature of the host operating system; therefore the data that it contains might be visible or subject to modification by native applications. The programming interface provided by the RecordStore class is intended to be simple enough that it can be implemented across a variety of different platforms. A RecordStore does not expose the details of the underlying storage mechanism.

A RecordStore is identified by its name, which is a string of up to 32 Unicode characters. RecordStores can be shared by all MIDlets in the same MIDlet suite; hence, the name must be unique within the MIDlet suite. RecordStores belonging to one suite are not visible to MIDlets in other suites as the MIDlet suite itself is implicitly part of the RecordStore name. As a result, MIDlets in different suites can create stores with the same name without conflict.

The static openRecordStore() method opens an existing RecordStore given its name. The createIfNecessary argument should be set to true to create the RecordStore if it does not already exist. The openRecordStore() method may be called several times within the same MIDlet and will always return the same RecordStore instance given the same name. When a MIDlet no longer needs to access a RecordStore, it should call the closeRecordStore() method. Note that ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required