Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Agile forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

retrieve record store from a different Midlet

 
liang gu
Ranch Hand
Posts: 89
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 1427
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The two MIDlets must be in the same MIDlet suite to share a record store. It is a security requirement.
 
liang gu
Ranch Hand
Posts: 89
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 164
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 1427
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yeah, basically they have to be in the same JAR (manifest) and listed in the same JAD file.
 
Rishi Tyagi
Ranch Hand
Posts: 102
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 1427
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 102
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
---------------------------------
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
Posts: 164
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 1427
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 164
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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!).
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic