Search code examples
androidmodepersistent-storage

Android internal storage, which mode should I use?


I'm making an app that has a listview with a child listview for each parent listview item. The children have a few children items as well. You can add/delete an element from any of these lists. I'm concerned that using MODE_APPEND will be a difficulty because I'm assuming it just appends to the end of the file and I actually want the elements to be grouped together in the file. I'm doing all of this to make sure that the data is available upon the application being destroyed and reopened. I'm also worried that MODE_APPPEND isn't private like MODE_PRIVATE is.

http://developer.android.com/reference/android/content/Context.html#MODE_APPEND


Solution

  • I wouldn't use MODE_APPEND. There shouldn't be no security concerns about that, but it should be easier to handle (group by datatypes, ...) the data by reading and writing the file each time.

    Another possibility could be using SQLite as database for storing these values.