What is the best way to access static data for an Android app
Information about the data
- Will be read-only, the user cannot change it
- Data will consist of an ID, and a few words/short phrases
- It won't be huge: maximum of about 1000 words/short phrases
- The data will be accessed sequentially
- I will have the data while developing the app
- The data will be read frequently
From what I've read on the web so far, I have a few options:
- Load all the static data into an SQLite database when the app starts. This is the secure way of doing it because then only rooted users can delete/change data. Also, Android allready has SQLite and querying is easy. Can be read sequentially with
cursor.moveToNext()
method - Read the data from a flat/xml/csv file from within the app's resources. I don't know how the speed of reading from a file compares to using SQLite? Also, if I've got to reference to a particular line (which will be a word/phrase) in the file, what is the difference between that and just hardcoding it?
What is the best option? Are there better solutions?