J2ME: Transferring RMS Data from Emulator to Mobile Device  
Author Message
swy128





PostPosted: 2006-11-5 8:33:00 Top

java-programmer, J2ME: Transferring RMS Data from Emulator to Mobile Device 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.

 
swy128





PostPosted: 2006-11-8 12:10:00 Top

java-programmer >> J2ME: Transferring RMS Data from Emulator to Mobile Device Hi... Please assist... I desparately need help on this issue. Thanks!

Simon.

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

 
Simon Brooke





PostPosted: 2006-11-8 17:19:00 Top

java-programmer >> J2ME: Transferring RMS Data from Emulator to Mobile Device in message <email***@***.com>, swy128
('email***@***.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.

--
email***@***.com (Simon Brooke) http://www.jasmine.org.uk/~simon/

;; in faecibus sapiens rheum propagabit