Data in J2ME RecordStore does not persist across sessions

前端 未结 7 582
渐次进展
渐次进展 2021-01-06 21:50

I\'m building a mobile app with J2ME, and I\'ve found that the data I write into a RecordStore can be accessed while the program is still running but it is lost after quitti

7条回答
  •  广开言路
    2021-01-06 22:19

    If you use Sun WTK, it creates a file named "in.use" in its "appdb" folder:

    C:\WTK25\appdb\DefaultColorPhone\in.use
    

    If you close your emulator in unusual way (kill a process, for example), it would not delete it, and next time you run emulator, it would create temporary folder for storing data:

    C:\WTK25\appdb\temp.DefaultColorPhone1
    

    when starting this way, it should print in console: "Running with storage root temp.DefaultColorPhone1".

    I fix it, including into my ".bat" file a line for deleting "in.use" file each time, emulator runs. But you should be careful when running several emulators at once.

提交回复
热议问题