Re: J2ME: Transferring RMS Data from Emulator to Mobile Device
in message <1162958980.973990.88110@e3g2000cwe.googlegroups.com>, swy128
('swy128@gmail.com') wrote:
Hi... Please assist... I desparately need help on this issue. Thanks!
OK, I am not an expert, but I think it can't be done.
The reason that it can't be done is that the RMS standard does not mandate
the format in which RMS data must be stored, and consequently it it likely
to be held in different places and in different formats on different
devices.
I suggest you store your default data in a file on a server somewhere, and
when your MIDlet starts up it should do something like:
RecordStore qdb = null;
try
{
qdb = RecordStore.openRecordStore(
getAppProperty( STORENAME ), false );
}
catch ( RecordStoreNotFoundException rex)
{
/* store doesn't exist: create... */
qdb = RecordStore.openRecordStore(
getAppProperty( STORENAME ), true );
/* ... and initialise it */
BufferedReader buffy =
new BufferedReader(
new InputStreamReader(
Connector.openInputStream( INITDATAURL)));
for ( String rec = buffy.readLine(); rec != null;
rec = buffy.readLine())
{
qdb.addRecord( rec.getBytes(), 0, rec.length());
}
}
Note: that's off the top of my head, I haven't tried it.
--
simon@jasmine.org.uk (Simon Brooke) http://www.jasmine.org.uk/~simon/
;; in faecibus sapiens rheum propagabit