Data in J2ME RecordStore does not persist across sessions

前端 未结 7 659
渐次进展
渐次进展 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:15

    This question has been around for a while but I stumbled upon it whilst looking for an answer to the same problem with the emulator but in my case it was when using the Java ME 3 SDK. It is possible that the solution I found might also fix this problem.

    Using:

    emulator -Xdescriptor:/path/to/app.jad
    

    will according to the docs: "Install a MIDlet, run it, and uninstall it after it finishes."

    To persist an installation (and it's data) you should use:

    emulator -Xjam:install=
    

    The JAD file URL can either be a web address or 'file:///path/to/app.jad' if you want to install from your local file system. This installation command will display an application storage number which you can then use to launch the emulator and run the previously installed app by calling:

    emulator -Xjam:run=
    

    See the docs for further command line options.

提交回复
热议问题