Вопрос

I want to store the setting of my j2me application. When application starts, the setting will be loaded. Two ways I found are

  1. RecordStore
  2. Read and write in text files

What I think is,

Risk using Record Store if user delete RMS data then I will loose the settings. Text file can be stored in jar so user can't delete them.

Which is best approach from above two considering performance and above risk or is there better approach than above two?

[Appending]

Regarding RMS files

Suppose user access the mobile storage from computer then RMS files are visible. And regarding text files, if i store the txt file in apps resources, then it will be a part if jar file and user wont be able to access it. when application is uninstalled that file will also get deleted as it is part of jar. Considering this as well what will be best approach

Это было полезно?

Решение

RMS is definitely the best solution.

There is no way for a user to delete an app's RMS data unless you provide one.

Also, if the user uninstalls your app, the data will be deleted at the same time: this is a good thing.

Using text files is a bad idea because the user can access it and delete it at any time, and you have no way of deleting it when the user uninstalls.

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top