RMS Basics in J2ME
By Daniel Malcolm Viewed: 31826 times Emailed: 277 times Printed: 315 times
The RMS API abstracts the device-dependent details of the storage area and access to those details, and it provides a uniform mechanism to create, destroy, and modify data. This ensures portability of MIDlets to different devices.
RMS Data Storage Model
The RMS supports the creation and management of multiple record stores, shown in Figure below. A record store is a database whose central abstraction is the record. Each record store consists of zero or more records. A record store name is case sensitive and can consist of a maximum of 32 Unicode characters. A record store is created by a MIDlet.
MIDlets within the same MIDlet suite can share one another's
record stores. A MIDlet suite defines a name space for record stores; a record store must have
a unique name within a MIDlet suite. The same name can be used in different MIDlet suites,
however.
MIDlets can list the names of all the record stores available to them. They can also determine the amount of free space available for storing data. Incidentally, you should be aware that when all MIDlets in a MIDlet suite are removed from a device, the device AMS removes all record stores in the MIDlet suite namespace. All persistent data will be lost. For this reason, you should consider designing applications to include a warning or confirmation that requires users to acknowledge that they understand the potential loss of data when they remove applications. Applications might also include a mechanism to back up the records in a data store to another location. This might require server side support.
The RMS defines the following conceptual operations on an individual record store:
• Add a record.
• Delete a record.
• Change a record.
• Look up (retrieve) a record.
• Enumerate all records.
Records are uniquely identified by a record ID, which is
the only primary key type supported. The type of all record ids is the Java built-in type int. The RMS
has no support for features—such as tables, rows, columns, data types, and so forth—that are
present in relational databases.
Records
A record is a byte array of type byte []. The RMS doesn't
support the definition or formatting of fields within a record. Your application must define the data
elements within a record and their format.
The reader of a record, therefore, must be aware of the format
that was used to write the record. Because a record is simply a byte array, applications must
convert data from arbitrary types to bytes when writing records, and they must convert from bytes to
those types upon reading the data.
Comments(10)
| 1. | Just what i was looking for. tku. |
| 2. | rms programe |
| 3. | Hi hardik, |
| 4. | If i delete a record, will that recId be replaced by next one. |
| 5. | I will try |
| 6. | can you give me tutorial how to copy phonebook to RMS???please :) |
| 7. | I want to enter data from a textbox to recordstore and print it again on the emulator screen Please help me.Can anybody provide the revelant code |
| 8. | hie |
| 9. | i will make to try for rms :) |
| 10. | very brief and easy to understand description of RMS |
Latest Tutorials
More Latest News
Most Viewed Articles (in last 30 days)

