This week's book giveaway is in the Android forum.
We're giving away four copies of Head First Android and have Dawn & David Griffiths on-line!
See this thread for details.
The moose likes Java Micro Edition and the fly likes Record store gets overwritten Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Head First Android this week in the Android forum!
JavaRanch » Java Forums » Mobile » Java Micro Edition
Bookmark "Record store gets overwritten" Watch "Record store gets overwritten" New topic

Record store gets overwritten

kalyen kumar
Ranch Hand

Joined: Sep 18, 2008
Posts: 53

I wrote a j2me simple application for RMS.
For the first time I add 2 records.

Now running my application prints

key1 = value1
key2 = value2

Next I exit my midlet, I mean I close my emulator.
Now I modify the above code to add another 2 more records.

Now running my application again prints

key3 = value3
key4 = value4

instead of

key1 = value1
key2 = value2
key3 = value3
key4 = value4

I create my record store as

Any idea, why my records in record store are getting overwritten...?

Thanks in advance

kalyen kumar
Ranch Hand

Joined: Sep 18, 2008
Posts: 53
Hey I figured it out....

RMS data is lost after the emulator exits.This is a normal characteristic of the emulator.
To keep RMS data, you need to "install" the application on the emulator.

Thanks everybody.
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 16901

kalyen kumar wrote:

Thanks everybody for giving me the opportunity to find the answer for myself.

Sarcasm? I hope not. We don't get paid here, so questions get answered if/when someone finds it convenient. Fortunately, we get enough traffic that lots of people are available to find it convenient.

But at least it didn't take you too long. And thanks for letting us know!

Customer surveys are for companies who didn't pay proper attention to begin with.
kalyen kumar
Ranch Hand

Joined: Sep 18, 2008
Posts: 53

Hey, Its not....
Please consider it in a positive way, I was really happy to find the answer for myself.
I apologize, if that line in my posting hurts anybody in anyway.

I know that you guys are not paid for this and you are helping us......
so that is why I continued my trials to find the answer after posting the question.

I would have not posted the answer that I found, if I feel that you guys are not responding.
The reasons are for my posting are:-

1) As I am new to j2me, I wanted someone, if willing to confirm that I am on the right path.
2) If the answer I posted is correct it would help some who is facing the same problem.

Please note that I am not very new member and I already got very good answers from members here to my previous questions.
I am not here to hurt anybody, I am here to learn something from you all....
I feel that i need to remove that line in my posting.......these actions are purely for your comfort but not an acceptance that its sarcasm.

It is sorta covered in the JavaRanch Style Guide.
subject: Record store gets overwritten
jQuery in Action, 3rd edition