This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
I have a midlet (call it Midlet-A) running on a Sony p900, it has been running for several weeks and has alot of data stored in it's record store.
Unfortunately, when I created the record store I did not know about the permissions you can set on a record store to allow other midlets (i.e. other than the one that created it) to access it. Hence it was created with default permissions, i.e. private.
Now I (desperately!) need to extract the information from that record store and place it on a PC. I can do this by opening a socket connection to the PC while the p900 sits in a cradle so, that's no problem. The problem is accessing the data from that record store :-(
I have another midlet (let's call it Midlet-B), the one who makes the socket connection described above) who would like to read from the original record store - but according to the API I can't because I didnt specify a 'share' permission when the record store was created.
If I could go 'back in time' I could select share permissions on the record store (or integrate the 'export over socket' functionality into Midlet-A).
The data in the record store is absolutely crucial, can anyone think of any way that the other midlet can read it..?
If I unistall Midlet-A then the record store is destroyed so that's not an option. Is there even perhaps a way to 'update/replace' Midlet-A without destroying the record store..?
Is there *any* way of getting the data from the record store and even storing it in a 'half way house' on the p900..?
Any help/suggestions/advice majorly appreciated. thanks.
Hard question... :roll: You could create a MIDlet that will be the update of your MIDlet-A. In the new version you can implement the read features missing in the actual one (maybe with an http connection to send data to a server ).
When you update your MIDlet (if the device keeps the specs) the rms should be left untouched or at least should ask fot it to the user. Therefore with the new version you could use the new functionality you implemented to read data.
Remember that if the device does not support this practice (leave data of rms during update) you will loose data! be careful... make some tests with other midlets before that try. If this feature is not supported, on the SE P900/P800 you could also copy the rms.db fileof your MIDlet from the device filesystem to the PC, using an application like "PC File Manager" from epocware.com On my P800 MIDlets are within C:\system\MIDlets\<something like [1014738d]> (where C is P800 file system, D is the memory card). After the installation of the new MIDlet (at this point also MIDlet-B) you could re-insert the rms.db file in the directory of the new MIDlet and access to data from your MIDlet.