J2ME: Transferring RMS Data from Emulator to Mobile Device

S

swy128

We are planning to use the RMS to store our mobile application's
resource data (plain text), which are mainly used for populating the
drop downs (a.k.a. Choice Group) in the GUI. We have a lot of files
that need to be deployed with the mobile application. One of them has a
size of about 300K! It is fast to just download the file(s) via http.
However, it takes a very long time to process the downloaded data. By
"process", I mean by first storing the downloaded data in an RMS record
store and then place the data to different RMS record stores according
to certain criteria. We do this "process" because the requirements
state that we cannot show hundreds of data item in the drop downs at
any given instance for the sake of usability.

I would like to know if it is possible for us to use the J2ME emulator
to first load the resource data into the emulator's RMS, and then
deploy the emulator's RMS to the mobile device. If possible, how to do
it?

Thanks!

Simon.
 
S

Simon Brooke

swy128 said:
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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,763
Messages
2,569,563
Members
45,039
Latest member
CasimiraVa

Latest Threads

Top