The MIDP RMS RecordStore implementation is used to store data persistently on the BlackBerry device. RMS stores data between application instances as well as after device resets. The javax.microedition.rms.RecordStore API is used for this.
The record store class enables you to store byte arrays to a named section of device storage. The data can then be retrieved directly from the record store in byte format using the record number (a unique ID given to each record as it is added). Additionally, functionality is provided to create an enumeration of all records in a record store.
To add a record to a RecordStore
RecordStore recordStore = RecordStore.openRecordStore("FILE NAME", true);
int id = recordStore.addRecord(_data.getBytes(), 0, data.length());
Although the RecordStore does not need to be closed until the object is no longer needed, it is good practice to close the RecordStore when you are not using it for an extended time, so that your data is always saved in the event that the program stops responding.