java - Best way to store array persistently in Android without using SQLite -


i have array in android application store when application closed , later restore when application opened again. know 1 stores larger amounts of data in android in sqlite database. have arrays i'd store. therefore know best method doing is.

best means following me:

  • good performance

  • easy, non-complicated code

  • able t store multi-dimensional arrays , arraylists

the following possibilities i've come with:

  • json

  • xml

  • metaprogramming store array in text file initialize , read using metaprogramming. it's not easy, doable in java.

though of course in not exhaustive list. best way store array in java according criteria above?

i know not typical q/a quenstion think have provided clear criteria , examples, doesn't violate stackoverflow "question rules"

there 4 basic methods data storage in android.

  1. internal storage- private folder can write files to. can write small file there, , read back.
  2. external storage- same internal, except other applications can see it. sd card. useful large data sets don't want in internal limited memory, , don't mind sharing (mp3's, images, etc)
  3. sqlite database- best large sets of data in tabular type format.
  4. shared preferences- best small amounts of data, use store preference values, maybe high scores, etc. doesn't natively store arrays, store json string, mentioned possibility.

for storing set of high scores, used internal storage folder, seemed work enough purposes. once choose method, should able figure out how write/get data appropriately. if can't, feel free ask question figure piece out.


Comments

Popular posts from this blog

php - regexp cyrillic filename not matches -

c# - OpenXML hanging while writing elements -

sql - Select Query has unexpected multiple records (MS Access) -