• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How do i change the storage_root of the *.db file

 
R K Sharma
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have code to stored the value using RMS in J2ME. It's working fine on emulator. So, my first problem is

When i restart the emulator all the stored values are deleted.

Stored values are showing in the emulator, but not in the Mobile, in which i am testing my application.

So, i want to change the storage_root of the *.db file. How can i solve these problem.


Note : I'm using NetBeans 6.9.1 for developing my J2ME application.
 
Walter Gabrielsen Iii
Ranch Hand
Posts: 158
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I don't think the changes you make in the Netbeans emulator will have an affect on the mobile. The RMS store is designed to be device dependent storage area and beyond the API classes that's out of your hands to access and control in the Mobile.

Though I seem to remember that the FileConnection API part of jsr 75, part of MSA, might help in accessing the file system on the mobile. But the MIDlet may need to be signed or have set a request to access the API's file access permission (In your projects properties go to: Application Descriptor > API Permissions tab > Add button).

As for Netbeans, If you want to mount a fake storage device for testing then Run your project to open the emulator and at least in the DefaultCldcMsaPhone there is an external events generator: Device menu > FileConnection > Mount Copy button. It lets you choose a folder on your computer to act as a storage device for testing purposes of jsr 75.
 
Darryl Burke
Bartender
Posts: 5148
11
Java Netbeans IDE Opera
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
'GraviTy zErO' please check your private messages for an important administrative matter.
 
R K Sharma
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
which API, should i add ..??
 
Walter Gabrielsen Iii
Ranch Hand
Posts: 158
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Project properties > Platform > "File Connection and PIM Optional Packages."
 
R K Sharma
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Walter Gabrielsen Iii, this was not my question, my question was, there are too many API available, which API should i select.? And, in you last reply, you told Project properties > Platform > "File Connection and PIM Optional Packages.". But, in my case, it was already selected.
 
Walter Gabrielsen Iii
Ranch Hand
Posts: 158
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you want the download link to the API: JSR-000075 PDA Optional Packages for the J2ME Platform .

It is divided into two parts:
1. FileConnection Optional Package.
2. PIM Optional Package.

You want the FileConnection one.
 
Walter Gabrielsen Iii
Ranch Hand
Posts: 158
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Also attached to this post are some screenshots of the emulator and how to mount a test folder.
Phone1.png
[Thumbnail for Phone1.png]
The "Settings" Menu with the appropriate "File Connection" option are displayed.
Phone Settings.png
[Thumbnail for Phone Settings.png]
The External Events Generator window. Use the Mount Copy button to open a file browsing window.
 
Walter Gabrielsen Iii
Ranch Hand
Posts: 158
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Also I think I should write a note:

You can't alter the RMS on the mobile phone in any way beyond the methods in javax.microedition.rms package. You can't change its file location or even access the storage area where the files are stored from outside the MIDlet.

If you aren't entering data into the RMS then it will be empty. You can't Load it up or replace the RMS with another preset default RMS file unless you do so using the methods provided in the javax.microedition.rms package.

If you uninstall the MIDlet then you'll loose access to the RMS (it's erased). If you install the MIDlet it will be assigned a new empty RMS storage space. If you want to access the RMS store of another MIDlet its record store would have had to have been created specifically with the "AUTHMODE_ANY" Authorization mode from the other MIDlet.


If this is for Netbeans only, I don't know how to keep a record store around in the emulator between runs. Maybe if you use the install it on the emulator using the OTA (Over the Air Provisioning) option instead of the default run mode:

Project Properties > Running > "Execute through OTA (Over the Air Provisioning)"
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic