j2me and RMS

R

Rohit

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.
 
D

Darryl L. Pierce

Rohit said:
- 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>
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,743
Messages
2,569,478
Members
44,899
Latest member
RodneyMcAu

Latest Threads

Top