100% found this document useful (2 votes)
167 views12 pages

J2ME - Record Management System: Rohan Chandane

This document discusses the basics of J2ME Record Management System (RMS) which allows MIDlets to persistently store and retrieve data even after a device is switched off. RMS stores data in binary format records within a record store on the mobile device. The javax.microedition.rms package provides a RecordStore class to manage records through methods like open, close, add, get, delete. Records can be enumerated, filtered and events monitored through interfaces like RecordEnumeration, RecordFilter and RecordListener respectively.

Uploaded by

saurabh_amit
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
100% found this document useful (2 votes)
167 views12 pages

J2ME - Record Management System: Rohan Chandane

This document discusses the basics of J2ME Record Management System (RMS) which allows MIDlets to persistently store and retrieve data even after a device is switched off. RMS stores data in binary format records within a record store on the mobile device. The javax.microedition.rms package provides a RecordStore class to manage records through methods like open, close, add, get, delete. Records can be enumerated, filtered and events monitored through interfaces like RecordEnumeration, RecordFilter and RecordListener respectively.

Uploaded by

saurabh_amit
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 12

J2ME –

Record management system

Rohan Chandane
[email protected]

This notes are created by me, Rohan Chandane as learning material while pursuing MSc (CA) from SICSR. (CC) 2005-07
Basics
 Record Management System (RMS)
 Provides a mechanism
 MIDlets can
 Persistently store data
 Retrieve it later even if device switched off
 It stores data in binary format in mobile
device
Overview of J2ME RMS and
MIDlet interfacing
Records and Record Store
 Storage Mechanism termed as
 Record Store
 Record Store consist
 Records – Individual units of storage
 Record
 Is an array of bytes
 Stored in binary file
Package
 Package used
 javax.microedition.rms
 For Record stored class used
 javax.microedition.rms.RecordStore
 Provides several methods to manage
records in Record Store
 Insert
 Update
 Delete
RecordStore Class
 Methods in RecordStore
 openRecordStore()
 Open Record Store
 closeRecordStore()
 Close Record Store
 deleteRecordStore()
 Delete Record Store
 enumerateRecords()
 Used to obtain enumeration object, which
represents entire set of records in Record Store
Continued…
 getName()
 Used to obtain name of Record Store
 getRecord()
 Retrieve a record from Record set
 getNumRecord()
 Obtain a number of records in Record Store
 addRecord()
 Add record to Record Store
 deleteRecord()
 Delete record from Record Store
Continued…
 Interfaces in RMS package
 RecordEnumeration
 Provide navigation in both direction through
record store
 It has following methods defined
 nextRecordId() – returns Id of next record
 nextRecord() – returns next record
 previousRecordId() – returns Id of previous record
 previousRecord() – returns previous record
 hasNextElement() – true, if there is next record
 hasPreviousElement() – true, if there is previous
record
Continued…
 RecordComparator
 Provide comparison between two records in a
record store
 RecordFilter
 Provide a mechanism to check if a record
matches a specific criterion
 RecordListener
 Provide an event listener that is notified when
event is added, deleted or modified
Managing record stores
 Open a RecordStore
RecordStore rs = RecordStore.openRecordStore("MyAppointments",true);

 Close a RecordStore
Rs.closeRecordStore();

 Delete a RecordStore
RecordStore.deleteRecordStore("MyAppointments");
Continued…
 Insert a record
String appt = "new record";
byte bytes[] = appt.getBytes();
rs.addRecord(bytes,0,bytes.length);

 Updating records
String newappt = "update record";
Byte data = newappt.getBytes();
Rs.setRecord(1, data, 0, data.length());
Continued…
 Deleting records
Rs.deleteRecord(1);

You might also like