aspose file tools*
The moose likes Java Micro Edition and the fly likes retrieve record store from a different Midlet Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Mobile » Java Micro Edition
Bookmark "retrieve record store from a different Midlet" Watch "retrieve record store from a different Midlet" New topic
Author

retrieve record store from a different Midlet

liang gu
Ranch Hand

Joined: Nov 05, 2001
Posts: 89
I was just trying to save the data in one Midlet, then try to open the data store with the same name in another Midlet. However, I have not been successful on this. Has anybody tried this with success??
Thanks!
Liang
Michael Yuan
author
Ranch Hand

Joined: Mar 07, 2002
Posts: 1427
The two MIDlets must be in the same MIDlet suite to share a record store. It is a security requirement.


Seam Framework: http://www.amazon.com/exec/obidos/ASIN/0137129394/mobileenterpr-20/
Ringful: http://www.ringful.com/
liang gu
Ranch Hand

Joined: Nov 05, 2001
Posts: 89
What is a Midlet suite? Where can I found some online document on this? I have NOT found any detail information on Midlet suite from J2ME API document. Thanks a lot.
Liang
a sanjuan
Ranch Hand

Joined: Jun 12, 2002
Posts: 164
i think a book would help by giving a detailed overview of the entire topic.
when you package your midlets+supporting classes into a jar file, that's your midlet suite....so all midlets in that group can access the same recordstores. go to the jad file for your app, it should have the midlets listed.
[ August 01, 2002: Message edited by: a sanjuan ]
Michael Yuan
author
Ranch Hand

Joined: Mar 07, 2002
Posts: 1427
Yeah, basically they have to be in the same JAR (manifest) and listed in the same JAD file.
Rishi Tyagi
Ranch Hand

Joined: Feb 14, 2002
Posts: 100
In my views it depends on the implementation by different mobile vendors.
As in WTK environment we can read the Records from midlet written(saved) by some another midlet but when we run the same application on some another emulators it does not allows us to read the data written by different midlet.
What we can think this is due to the fact that
WTK save all Record Stores in the same directory named appDB so any midlet running in the WTK environment can read any RecordStore in this environment. and so the mobile phones which implements the recordstores in the same way as in WTK will allow to read any RecordStore saved in this directory
But most of the phones/emulators save the RecordStore files in some subdirectory under the directory of the MIdLet and because a MIDlet can't access the recources of another Midlet so in this case Midlet Application will be able to read the Records which has been made by this Application only.
One way to read the old Records made by another MIDlet is just copy the files of old Record Stores inside the directory of the application which is to be read the data. In this way you can use the old RecordStores made by another application but you will have to do a mannual work here and is not recomended.
But Two midlet will share the same RecordStore if the phone/emulator implementation for RMS allows for this.
Rishi
Michael Yuan
author
Ranch Hand

Joined: Mar 07, 2002
Posts: 1427
Originally posted by Rishi Tyagi:
In my views it depends on the implementation by different mobile vendors.

No. The "only MIDlets from the same suite can access common RecordStore" rule is in the MIDP (1.0 and 2.0) specification. It is one of the major security features of MIDP.
This is definately not dependent on implementation. If some implementation violates this rule, it cannot be called MIDP ...
Rishi Tyagi
Ranch Hand

Joined: Feb 14, 2002
Posts: 100
---------------------------------
Originally posted by Rishi Tyagi:
In my views it depends on the implementation by different mobile vendors.
--------------------------------
Sorry guy's , I was wrong here, Thanks Yuan for recalling.
Regards,
Rishi
a sanjuan
Ranch Hand

Joined: Jun 12, 2002
Posts: 164
this is sorta vague, but i think this is saying that in MIDP 2.0 it will be possible for a midlet in one suite to explicitly set a recordstore in its care to become accessible to other suites.
"New APIs in MIDP 2.0 allow for the explicit sharing of record stores if the MIDlet creating the RecordStore chooses to give such permission."
"Sharing is accomplished through the ability to name a RecordStore in another MIDlet suite and by defining the accessibilty rules related to the Authentication of the two MIDlet suites."
[ August 02, 2002: Message edited by: a sanjuan ]
Michael Yuan
author
Ranch Hand

Joined: Mar 07, 2002
Posts: 1427
Originally posted by a sanjuan:
this is sorta vague, but i think this is saying that in MIDP 2.0 it will be possible for a midlet in one suite to explicitly set a recordstore in its care to become accessible to other suites.

Yes, yes. Sorry, I forgot that MIDP 2.0 has much more refined access control and can therefore afford to allow this ... Thanks for the pointer, Sanjuan.
a sanjuan
Ranch Hand

Joined: Jun 12, 2002
Posts: 164
i think this is good, and makes the system a heck of a lot more flexible. it's also one way to get around the size limitation imposed in some devices (30 kb!).
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: retrieve record store from a different Midlet