j2me and RMS

Discussion in 'Java' started by Rohit, Apr 2, 2004.

  1. Rohit

    Rohit Guest

    Hello All,



    I know j2ME with MIDP 1.0 does provide some primitive persistent
    storage support in terms of the recordstore (RMS APIs).

    I am building an application that will be storing about 200 records
    each record of about 20 characters.

    Can someone help me on these points:



    - What are the things that I should take care of, while creation of
    the Recordstore and then accessing individual records from the store?

    - Is there a physical limit on the size of the recordstore in the
    device or is it the maximum available memory on the device?



    - Are there any issues with different devices (Blackberry, Palm,
    Nokia, Sony,etc)



    - How is the recordstore stored on the device? Can I access the same
    from some other application (non java)?



    - What are the maintenance issues in the long term for the database
    (in this case the recordstore)?



    I have written a small code to write something into a recordstore and
    then access it using the enumerateRecords method available in
    recordstore. This may cause a problem when I am accessing bigger
    record stores. ???



    - Is there a fixed memory allotted to the MIDlet which it can use
    during its working? What if the MIDlet exceeds this memory limit?



    Any pointers would be helpful,



    Regards,

    Rohit.
    Rohit, Apr 2, 2004
    #1
    1. Advertising

  2. Rohit wrote:

    > - What are the things that I should take care of, while creation of
    > the Recordstore and then accessing individual records from the store?


    What do you mean by "take care of"? There's no real up-front work to be done
    outside of design before you work with the RMS layer.

    > - Is there a physical limit on the size of the recordstore in the
    > device or is it the maximum available memory on the device?


    It depends on the device. According to the MIDP specification, the device
    need only provide a minimum of 8k, though most devices provide more.

    > - Are there any issues with different devices (Blackberry, Palm,
    > Nokia, Sony,etc)


    Oh, yes, there are. Motorola iDEN, SprintPCS and Siemens phones all have
    *sloooooow* RMS layers with a response time of about 300ms to retrieve a
    single record. Nokia on the other hand is lightning fast.

    > - How is the recordstore stored on the device?


    That's implementation dependant.

    > Can I access the same
    > from some other application (non java)?


    No.

    > - What are the maintenance issues in the long term for the database
    > (in this case the recordstore)?


    Most devices don't physically remove data when a record is deleted from a
    store, so you'll need to at some point rebuild your stores. Providing a
    separate utility MIDlet in your MIDlet suite is a good way to do it.

    > I have written a small code to write something into a recordstore and
    > then access it using the enumerateRecords method available in
    > recordstore. This may cause a problem when I am accessing bigger
    > record stores. ???


    No, that's how you enumerate records in order to access them...

    > - Is there a fixed memory allotted to the MIDlet which it can use
    > during its working?


    That's implementation dependant.

    > What if the MIDlet exceeds this memory limit?


    As with any Java virtual machine, when you exceed memory, an
    OutOfMemoryError is thrown and your VM goes into a very non-deterministic
    state. Most handsets will shutdown your application and report an error,
    but some will allow the application to continue (which is bad).


    > Any pointers would be helpful,


    Check the J2ME FAQ: <http://mcpierce.mypage.org/j2mefaq.html>

    --
    Darryl L. Pierce <>
    Visit the Infobahn Offramp - <http://mypage.org/mcpierce>
    "What do you care what other people think, Mr. Feynman?"
    Darryl L. Pierce, Apr 2, 2004
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. leggolas

    RMS and midlets

    leggolas, Mar 14, 2005, in forum: Java
    Replies:
    4
    Views:
    1,121
    leggolas
    Mar 22, 2005
  2. Replies:
    3
    Views:
    647
    jan V
    Sep 14, 2005
  3. swy128
    Replies:
    2
    Views:
    813
    Simon Brooke
    Nov 8, 2006
  4. Replies:
    2
    Views:
    4,428
  5. maaz
    Replies:
    0
    Views:
    319
Loading...

Share This Page