I want to store around a thousand strings (like some quotes) and populate a ListView
or ListFragment
using them. These strings are static and not likely to change once loaded.
It is a read-only data and user should not be allowed to manipulate it.
Should i store them using XML file or a text file, or what could be the best approach?
Use Sqlite db thats the efficient and secure way
Shared Prefrences is the best way to store small data. You Can take help from this tutorial
If the data are not going to change in the entire application development why u not going for static final way using with any access modifier as u like and u can use them in your application and as size concern thousand or lakh of String data is not going to effect as we know also String is immutable and can't change throughout the app life and one more thing with declaring as final so reinitialize will not be there but only reusing.Declare all the string in the as the class part so it load when class load i.e. once.If any more thing let me know.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With