• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

how to communicate between two midlet suits

 
Anil Sonone
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi,

can u please assist me on how to communicate between two midlet suits.How can we share recordStore lively i.e. if i make change is records it will get refelcted to another midlet suits.


Thanks and regards,
Anil Sonone.
 
Mark Spritzler
ranger
Sheriff
Posts: 17278
6
IntelliJ IDE Mac Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
A Recordstore is the only piece that you can share between MIDlet suites. Just have both suites open the RecordStore. Not sure if you can open them at the same time.

Try it out and see how it works and let us know.

Mark
 
Ko Ko Naing
Ranch Hand
Posts: 3178
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In this case, I think we need to apply a locking technique for RecordStores...
 
Sathya Srinivasan
Ranch Hand
Posts: 379
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
To my knowledge, a shared record store cannot be open simulataneously because the AMS is typically setup such that only one MIDlet will be active at a time. The MIDlet that first makes the openRecordStore("store", true, RecordStore.AUTHOMODE_ANY, true/false) would have the ability to delete the record store. Based on the last parameter, the record store can be setup such that only the MIDlet creating it can write to it, while others can only read from it (if parameter is set to false) or anyone can read and write from it (if parameter is set to true).

This way, data can be shared between MIDlets. By default, the operations are atomic. However, if you use multiple threads, you might have to have a locking mechanism as was suggested earlier. If not, it shouldn't be a problem.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic