GordonW
GordonW

Reputation: 1120

Advice around persisting app data

I'm looking for some advice on the best approach in storing some data within my app. The app data is structured around a series of Set and Map collections (these collections hold primitive as well as simple object data types).

I want to store the state of these various collections within the app and my question is on what would be the preferred way to store this data? I am looking at SQLite databases but before I go down that road would like to be sure it is the best option.

Thanks.

Upvotes: 0

Views: 35

Answers (2)

GordonW
GordonW

Reputation: 1120

In the end I ended up using GSON API to serialize each Collection and then store in internal storage. I use JSON (within GSON api) to both store and retrieve the data. For a small collection of non-primitive type Sets and maps it works well.

GSON available from google

Upvotes: 0

LaurentY
LaurentY

Reputation: 7653

To store data, Android provide several options: http://developer.android.com/guide/topics/data/data-storage.html

  • To store few key-value, use Preference.
  • To store structured data, use database (SQLite)

Upvotes: 1

Related Questions