aspose file tools*
The moose likes Java Micro Edition and the fly likes How do i change the storage_root of the *.db file Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Mobile » Java Micro Edition
Bookmark "How do i change the storage_root of the *.db file" Watch "How do i change the storage_root of the *.db file" New topic
Author

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

R K Sharma
Greenhorn

Joined: Aug 07, 2011
Posts: 12
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

Joined: Apr 09, 2011
Posts: 158
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

Joined: May 03, 2008
Posts: 4664
    
    5

'GraviTy zErO' please check your private messages for an important administrative matter.


luck, db
There are no new questions, but there may be new answers.
R K Sharma
Greenhorn

Joined: Aug 07, 2011
Posts: 12
which API, should i add ..??
Walter Gabrielsen Iii
Ranch Hand

Joined: Apr 09, 2011
Posts: 158
Project properties > Platform > "File Connection and PIM Optional Packages."
R K Sharma
Greenhorn

Joined: Aug 07, 2011
Posts: 12
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

Joined: Apr 09, 2011
Posts: 158
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

Joined: Apr 09, 2011
Posts: 158
Also attached to this post are some screenshots of the emulator and how to mount a test folder.



[Thumbnail for Phone1.png]


[Thumbnail for Phone Settings.png]

Walter Gabrielsen Iii
Ranch Hand

Joined: Apr 09, 2011
Posts: 158
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)"
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How do i change the storage_root of the *.db file