Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I put static data into an SQLite database in Android?

If I have a bunch of data that is never going to change (eg. an English language dictionary or the rgb values of a couple hundred color names), how do I use an SQLite database to store it? I know a database is faster than loading everything into memory when the app starts, but how do I make the database either the first time the app runs or "before" the apps ever runs?

like image 955
cstack Avatar asked Nov 14 '22 10:11

cstack


1 Answers

Why not just put it in SharedPreferences files? (Check here) No need to have all the power (overhead) of a SQLite database if all you'll be doing with this data is loading once and simple look ups (no updates, inserts, queries, etc)

like image 105
Ricardo Villamil Avatar answered Jan 04 '23 14:01

Ricardo Villamil