I have ListView with about 30 items. When I click on an item, some text displays.
Currently I am storing text in strings.xml, but I wonder if it’s better practice to insert this text into database.
What are advantages and disadvantages of both ways? Which is faster?
I have ListView with about 30 items. When I click on an item, some
Share
If the text is static, or not changing over time, I would definitely put it in strings.xml in your res folder. All XML files in your res folder are optimized and compressed when you create an .apk of your app. A database also introduces more complexity, and you will have to connect to the database before retrieving your text. If your text changes over time, you will need to put it in a database (or plain file, if you prefer that).