Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / November 2006

Tip: Looking for answers? Try searching our database.

J2ME: Transferring RMS Data from Emulator to Mobile Device

Thread view: 
swy128 - 05 Nov 2006 01:33 GMT
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 - 08 Nov 2006 04:09 GMT
Hi... Please assist... I desparately need help on this issue. Thanks!

Simon.

> We are planning to use the RMS to store our mobile application's
> resource data (plain text), which are mainly used for populating the
[quoted text clipped - 16 lines]
>
> Simon.
Simon Brooke - 08 Nov 2006 09:19 GMT
> 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.

Signature

simon@jasmine.org.uk (Simon Brooke) http://www.jasmine.org.uk/~simon/

                       ;; in faecibus sapiens rheum propagabit



Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.