×

Discussion Board

Results 1 to 7 of 7
  1. #1
    Registered User
    Join Date
    Jul 2003
    Posts
    37

    Bring the emulator recordstore file to the real phone

    Hi,
    I'm trying to develop a J2ME application that use a Recordstore. Before I install the app in the real phone, I try it first in the J2ME WTK and I use the Nokia S40 Emulator from Nokia SDK 1.0 (Nokia_S40_DP20_SDK_1_0). The application working and it can create the recordstore. In the emulator, I try to fill some data to the Recordstore. But when I deploy the app in the real phone, the data I have been filled in the emulator can't be transfered to the realphone. What I want is when I deploy the application in the real phone, the data that have been stored in the emulator can be stored automaticaly in the real phone too. How to do it? Can it be done by the compile the Recordstore file (.rms) with the Java source?

    Help me please...

    Thanks in advance...

    Cars

  2. #2
    Regular Contributor
    Join Date
    Mar 2003
    Posts
    87
    On some phones, like the Sharps, you can transfer the recordstore files to the phone, but on Nokias you can't.

    Your best option is write a small program that extracts the required data from the emulator recordstore file and then use that data to create a dat file in your 'res' directory.

    If needed you can then save the contents of the dat file to the recordstore on the phone once loaded.

    Hope that helps,

  3. #3
    Registered User
    Join Date
    Jul 2003
    Posts
    37
    Hi dmford, thanks for your reply. If I made the .dat file, how can I save the content from the .dat file to the recordstore? Do I have to add some script on my midlet source to open the .dat file then read the content and save it in the recordstore? Or it can be done automaticaly? If I have to add some script on my midlet to open the .dat file, it might be better if I use xml file rather that .dat file. I think it's easier to read xml file than dat file. I hope it can be done automaticaly...

    Cars

  4. #4
    Regular Contributor
    Join Date
    Mar 2003
    Posts
    87
    You should just be able to create an input stream to read in the data and then create an output stream from that to the Recordstore.

    When you save the data to a dat file save an int at the front indicating the number of bytes, then when you load in that data to save it to the RecordStore create a byte array the size of that integer (DataInputStream.readInt()) and then put the remaining data into that array. A ByteArrayOutputStream can then be created from that array and then simply send that to the Recordstore.

    Hope that helps further.

  5. #5
    Registered User
    Join Date
    Jul 2003
    Posts
    37
    Hi dmford, thanks again for your reply. I have try to store the data that I want to add to the phone RecordStore in the res folder, then compile it with the source. But I stored the data in the xml format. The data that I want to store in the recordstore are very many. It takes a long long time to add the data from the xml file to the recordstore (in the emulator takes more than an hour !!! ). So, I think my way is not efficient. If I replace the xml file with the dat file, will it be more efficient? Where I can find the tutorial or the example to create the dat file from the Recordstore?

    Thankyou very much

  6. #6
    Registered User
    Join Date
    May 2004
    Posts
    10
    On S60 devices you CAN do this. You need a 3rd party file manager because the built in one that doesn't allow you to access the system folders. With the file manager look for a System/MIDLETS (or similar, I don't have my 6600 at hand now) folder. Within that folder there are/is folder(s) with cryptic names these folders contain the MIDlets and their data. Look for the one that contains your MIDlet (you can recognice based on the JAR file's name), the rms.db in that folder contains your data. This file can be copied from device to device, and is also compatible with the S60 toolkit (not with the concept toolkit, but with the real one); just look for rms.db on you hard disk. - I routinely do this. However, it may not work on S40

  7. #7
    Regular Contributor
    Join Date
    Jun 2003
    Location
    Hungary
    Posts
    414
    If that transfer takes more than an hour I think that data is much bigger as a device can handle as RMS. Do you need to edit that data?
    If not, a simple binary or text resurce is appropirate for you.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×