Back | Tutorial Home | Next
(RMS)Record Management System has two new helpful functionalities in MIDP 3.0
Record Tags
In MIDP 2.0 there was no mechanism to categorize the records in the RMS. If you wanted to get few particular group of records then the algorithms using RecordComparater and RecordFilter had to be written. This meant that all the records are parsed and the suitable records are selected. This resulted is higher processing and higher time for processing.
With MIDP 3.0, Record tags make our life easier. When adding a record we can now add a record with a new parameter called tag.
addRecord(byte[] data, int offset, int numBytes, int tag) |
This tag can be queried
by using getTag(int recordId)
Lets take an example where we need have a record store of names and associated
gender. Then in the scenario without Record Tags we needed to add the records
in the following manner.
| Record ID | Record |
| 1 | Male|Allen |
| 2 | Female|Cindy |
| 3 |
Male|Scott
|
| 4 | Male|Moses |
In the above record store the gender and name are separated by pipes. If male names records are to be selected, then the Record Store has to be enumerated and then the male names have to be recognized by using Sting Tokenizing.
Now let us look at the Record Tags approach in MIDP 3.0
| Record ID | Record | Tag |
| 1 | Allen | 1 |
| 2 | Cindy | 2 |
| 3 |
Scott
|
1 |
| 4 | Moses | 1 |
In the above table tags have been set as 1 for Males and 2 for Females. So as the record store is enumerated use getTag(int recordId) to find the gender of the name in the record. This way we can group the records in the Record Store.
RMS Provisioning and RMS Interchange Format
MIDP 2.0 never had a mechanism where the Record Store can be package with the JAR files. Usually in this kind of scenario, files with data are packaged in the resource folder of the JAR file and are inserted into the Record Store on the first usage of the application.
MIDP 3.0 gives us a new functionality called RMS Provisioning. With this technology the RMS files are packaged in the format called RMS Interchange Format and can be created offline and packaged within a JAR file or as a separate file. The mime type of this file is .rms. RMS Interchange Format is not a simple text file but is an encrypted file with all the security hooks in place. The files can also be used with LIBlets.
Alternatively RMS file can be retrieved from the device after it is updated by the application. At this point of time it is not clear how RMS files can be created offline. Perhaps the WTK for MIDP3.0 will have a utility to create RMS file.
Back
| Tutorial
Home | Next
More Tutorials
MIDP for Beginners
MIDP Gaming
JSR 179: Location Based Services
This page is a part of
a frames based web site. If you have landed on this page from a search engine
click here to view the complete page.