Is it possible to use a static array as a fixed database to display a list of words?

I am working on an Android application that displays a list of words. I do not want the user to change the list. Is it good to use a static array as a fixed database to display a list of words (about 500 words)? Should I use a SQLite database? ... what is the advantage? Thanks!

+4
source share
2 answers

Until you change the array of words (its constant), a static variable should be good for you.

However, if you just keep words, I would suggest using SharedPreferences .

Otherwise, if you have big plans for this SQLite , this is the best way for you. The advantage of SQLite is that it offers a manageable and reliable way to store and access your data and is very reliable. Moreover, if you ever wanted to grow your number of words (say, hundreds of thousands), then SQLite handle this without any problems.

+3
source

Using an array seems perfectly fine for what you are doing, using the SQLite database on the phone seems redundant to me. The only reason I could do this is to expand later, if you plan to add additional features later, then SQLite db might be a way (or even distract it with ContentProvider for even more extensibility, but again, maybe will overwhelm your needs).

+1
source

All Articles