![]() ![]() This is a fairly minor consideration - probably worth consideration only if you need to access both the structured data and preferences before you can display the main activity. One final thought regarding speed and efficiency - if you need to use an Sqlite database for some structured data then it is probably more efficient to also store user preferences in the database so you are not opening a second file. So, if the nature of the data does not dictate your choice (as explained in accepted answer), and speed matters, then you are probably better to use SharedPreferences.Īnd reading some data is often on the critical path to displaying the main activty so I think speed is often very important. You don’t need to worry about a data center or a powerful network, and it runs very fast. Setup is fast and easy, and using the language is simple. + Syntax highlighting and query intellisense/auto-complete. The biggest advantage of SQLite is ease of use you can set it up on any machine (even a cellphone), and it doesn’t require much configuration. It has an easy to navigate interface, with the ability to perform the most basic to advanced tasks. ![]() If the amount of data is not too big, the Sqlite option will involve a larger and more complicated file with more processing overhead for simple access. SQLPro for SQLite is an advanced sqlite editor. This question has an accepted answer, but I think there is more to said on the topic - regarding speed.Īn application's SharedPreferences and Sqlite DB are both just files, stored in the application's directories on the device's file system. But as easy as it is to store a small amount of data as difficult it is to store and read large structured data as you need to define key for every single data, furthermore you cannot really search within the data except you have a certain concept for naming the keys. To read the data from the store you have to know the key of the data. SharedPreferences is a key/value store where you can save a data under certain key. Of course managing and searching large sets of data influences the performance so reading data from a database can be slower than reading data from SharedPreferences. ![]() This makes it possible to search in the data. As the data is structured and managed by the database, it can be queried to get a sub set of the data which matches certain criteria using a query language like SQL. Large amounts of same structured data should be stored in a SQLite database as databases are designed for this kind of data. It really depends on the data you want to store. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |