I'm creating an app where it can have tons of messages (let's say around 10,000). The user can browse them, see, select, send (e.g., those apps that show quotes and allows to send to someone). What should be the best way to store these messages? In the strings.xml, or in my own xml file. The app should work offline, so I do not consider using any internet connection or remote database, or even SQLite (once the messages will come with the app when the user installs it). When the user executes the app for the first time, the idea is to get all these messages (from strings, or other xml) and create a SQLite database. Which suggestion do you have?
Asked
Active
Viewed 139 times
2 Answers
0
What should be the best way to store these messages?
SQLite.
once the messages will come with the app when the user installs it
Use SQLiteAssetHelper
to ship a SQLite database with your app containing your quotes.
Bonus points for using FTS3 (or FTS4, depending on your minSdkVersion
) for supporting full-text searching. :-)

CommonsWare
- 986,068
- 189
- 2,389
- 2,491
0
Since it seems like you don't want to use a database, you can just make use of your strings.xml file and hardcode the quotes. Or like you said you could create your own xml. Whichever consumes less space on the user's device will be more preferable. Choice is yours...

Shully
- 78
- 8