Discussion Board

Results 1 to 6 of 6
  1. #1
    Registered User saira514's Avatar
    Join Date
    Mar 2009
    Posts
    3
    my app saves some data in record store, and simply view it! it works fine in emulator but when i deploy my app to mobile the data is lost. If i save some data in record store while using mobile, the data remains there! but the data saved while using emulator, does not show up when the app is running on mobile.
    im using netbeans 6.5, sun wireless toolkit emulator. below is my code:


    form1 = new Form("This is RMS DEMO");
    Display.getDisplay(this).setCurrent(form1);

    rs = RecordStore.openRecordStore("Student1", true);


    //Add a record

    String rec = "Some text";
    byte[] recbyte = rec.getBytes();
    rs.addRecord(recbyte, 0, recbyte.length);


    //Read records

    RecordEnumeration re = rs.enumerateRecords(null, null, false);
    while(re.hasNextElement()){
    String str = new String(re.nextRecord());
    form1.append(str);

  2. #2
    Registered User ektasrv's Avatar
    Join Date
    Oct 2009
    Location
    Noida
    Posts
    941
    When you deploy the app on the real device, only app is deployed on the device not the RMS or datafiles that you have created on the emulator.

    You need to add that old data again on the device.
    Thanks,
    Ekta

  3. #3
    Registered User saira514's Avatar
    Join Date
    Mar 2009
    Posts
    3
    1) yes this is what i was thinking. then what do all tha java apps use for persistent storage (so that the data should be retained in the device too) Can we somehow package the *.db file in our *.jar file?
    2) If not, then what is the solution (other than using text files)

  4. #4
    Registered User ektasrv's Avatar
    Join Date
    Oct 2009
    Location
    Noida
    Posts
    941
    Quote Originally Posted by saira514 View Post
    1) yes this is what i was thinking. then what do all tha java apps use for persistent storage (so that the data should be retained in the device too) Can we somehow package the *.db file in our *.jar file?
    2) If not, then what is the solution (other than using text files)
    1) -- Not possible to put RMS in device with JAR like this.
    2) -- You can include the data in a text file, recordwise (1 record per line) in the JAR, read it from JAR on the firts launch of the app, and add all lines(records) to the device RMS.
    Thanks,
    Ekta

  5. #5
    Registered User saira514's Avatar
    Join Date
    Mar 2009
    Posts
    3
    thanks for the suggestion.
    i have one more query. i dont know much about the usage of XML files but can we use them as an alternative to the method you told in your previous post.

  6. #6
    Registered User ektasrv's Avatar
    Join Date
    Oct 2009
    Location
    Noida
    Posts
    941
    Quote Originally Posted by saira514 View Post
    thanks for the suggestion.
    i have one more query. i dont know much about the usage of XML files but can we use them as an alternative to the method you told in your previous post.
    Yes you can use XML for this purpose, but then you require to use XML parser to first parse then store in RMS reading the XML from JAR.
    So I will reccomand to use simple text file in the JAR for this.
    Thanks,
    Ekta

Similar Threads

  1. Persistence of data in J2ME mobile device using RMS
    By playplay1978 in forum Mobile Java General
    Replies: 10
    Last Post: 2010-04-06, 02:49
  2. RMS data LOST problem in 3410!!!
    By bitsonic in forum Mobile Java General
    Replies: 6
    Last Post: 2009-03-27, 09:50
  3. some problems about deloying a mobile web application
    By ctlqt12 in forum Mobile Web Site Development
    Replies: 2
    Last Post: 2007-05-03, 05:38
  4. RMS lost on nokia 6108
    By alicegue in forum Mobile Java General
    Replies: 0
    Last Post: 2006-01-06, 07:52
  5. Crashing App by saving data in RMS
    By mildagenius in forum Mobile Java General
    Replies: 2
    Last Post: 2003-12-11, 23:17

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Nokia Developer aims to help you create apps and publish them so you can connect with users around the world.

京ICP备05048969号  © Copyright Nokia 2013 All rights reserved