1

I'm confused about when to persist data in mobile development. AT this stage I'm initializing a table with some values that will not change. Is there an advantage to storing this data in a table as opposed to initializing a list containing the data every time I want to access it? It just seems like a lot of work storing data to a table and retrieving it and I don't want to do unnecssary work if there's no advantages.

I Like
  • 1,711
  • 2
  • 27
  • 52

2 Answers2

1

It's going to depends on the amount and complexity of your data.

If you have much data or the data you actually have can grow you should use SQLite.

If you just have some configuration data like if you can notify the user or something like this or some string which is your case you should use SharePreference.

Check this answer https://stackoverflow.com/a/9529787/6727154

michaelitoh
  • 2,317
  • 14
  • 26
1

It doesn't sound like you have any changing data (CRUD) so I wouldn't use SQLite. Look into SharedPrefs as @Michael stated.

Keheira
  • 90
  • 1
  • 10