×

Discussion Board

Results 1 to 7 of 7
  1. #1
    Registered User
    Join Date
    Dec 2010
    Posts
    39

    RMS - physical file ?

    a) In my J2ME app - if I create a RecordStore named "List1", will it be stored in my phone as "List1.m3u" ?
    b) what's the exact location of the physical file ? or how to specify the file path where to create the recordStore ?

  2. #2
    Registered User
    Join Date
    Oct 2010
    Posts
    6

    Re: RMS - physical file ?

    Well, I think that RMS is not a good choice in your example. With RMS you can store binary data, without knowing the location and so on. This should be used to save some data (and load on next application start). And by the way data can be used only in your application (well, there is some RMS sharing between midlets, but I think that this is not a good option also).

    I think that you should use file connection for that (just look for JSR-75). In this case you will be able to create, modify and delete files, give it a proper name and location (to make it visible also from outside of the midlet).

  3. #3
    Super Contributor
    Join Date
    Jun 2003
    Location
    Cheshire, UK
    Posts
    7,395

    Re: RMS - physical file ?

    Quote Originally Posted by nathviswa View Post
    a) In my J2ME app - if I create a RecordStore named "List1", will it be stored in my phone as "List1.m3u" ?
    There is no rule that says how a RecordStore must be stored. Maybe in a file, maybe packed in a file with other RS's. Maybe in a database. Maybe it's a simple feature phone with no file system.

    Quote Originally Posted by nathviswa View Post
    b) what's the exact location of the physical file ? or how to specify the file path where to create the recordStore ?
    Since there is no requirement to store the data in a specific way (or a specific format for that matter), there is no requirement for a specific location. Most devices will store the data in a location to which other applications have no access.

    See also: Persistent Data in Java ME.

    Graham.

  4. #4
    Registered User
    Join Date
    Dec 2010
    Posts
    39

    Re: RMS - physical file ?

    Hi, I created a RecordStore with 5 strings ...... when I try to read the recordStore, the strings are not printed as created.

    while (re.hasNextElement()) {
    int id = re.nextRecordId();
    String s1=""+rs.getRecord (id); // rs.getRecordid (id).toString ()
    System.out.println(s1);
    mainScr.append ("Record:"+s1+" "+id);

    }
    The output is like B[@a16f18419

    how can I read recordStore to get the exact string written into earlier ??

  5. #5
    Super Contributor
    Join Date
    Mar 2008
    Location
    The Capital of INDIA
    Posts
    4,328

    Re: RMS - physical file ?

    Quote Originally Posted by nathviswa View Post

    while (re.hasNextElement()) {
    int id = re.nextRecordId();
    String s1=""+rs.getRecord (id); // rs.getRecordid (id).toString ()
    System.out.println(s1);
    mainScr.append ("Record:"+s1+" "+id);

    }
    The output is like B[@a16f18419

    how can I read recordStore to get the exact string written into earlier ??
    This is working as expected as the return type of the getRecord(int id) is byte array. You can use String constructor to get the data in terms of String.

    like :
    new String(recordEnumeration.getRecord (id));
    Thanks with Regards,

    R a j - The K e r n e l


    Join Delhi-NCR Nokia Developer's Community,

  6. #6
    Registered User
    Join Date
    Dec 2010
    Posts
    39

    Re: RMS - physical file ?

    It works. Thanks RAJ !!!

    I thought - concatenation or toString () will convert the byte array to String. But im wrong - as usual.

  7. #7
    Super Contributor
    Join Date
    Jun 2003
    Location
    Cheshire, UK
    Posts
    7,395

    Re: RMS - physical file ?

    Concatenating with an empty string gives the same result as calling the toString() method. Have a look at the specification for this method (in java.lang.Object), and you'll see why you get what you get...

    Graham.

Similar Threads

  1. RMS and Loading Midlet's config file to and from RMS
    By phungnguyen in forum Mobile Java General
    Replies: 4
    Last Post: 2010-09-13, 10:18
  2. Rename RMS File
    By jaceline in forum Mobile Java General
    Replies: 2
    Last Post: 2006-01-19, 01:02
  3. RMS.rms file
    By ochocki in forum Mobile Java General
    Replies: 2
    Last Post: 2004-08-26, 11:49
  4. RMS.rms file
    By ochocki in forum Mobile Java Networking & Messaging & Security
    Replies: 0
    Last Post: 2004-08-26, 07:50
  5. Minimum Physical Memory Needed by RMS?
    By walkal in forum Mobile Java General
    Replies: 0
    Last Post: 2004-03-17, 01:55

Posting Permissions

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