Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   Java (http://www.velocityreviews.com/forums/f30-java.html)
-   -   j2me and RMS (http://www.velocityreviews.com/forums/t132172-j2me-and-rms.html)

Rohit 04-02-2004 02:17 PM

j2me and RMS
 
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.

Darryl L. Pierce 04-02-2004 02:53 PM

Re: j2me and RMS
 
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 <mcpierce@myrealbox.com>
Visit the Infobahn Offramp - <http://mypage.org/mcpierce>
"What do you care what other people think, Mr. Feynman?"


All times are GMT. The time now is 11:50 PM.

Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.