This title makes me wonder on what is most suited feature in saving medium to large data on a specific application. I know there is a recent questions that i have seen on Stackoverflow regarding on saving data with these feature but I want to know, as what i have said, what suited most. Do you have any suggestion regarding to this?
To give an example, SharedPreferences are useful for storing user preferences, where there are just a handful of variables that need storing. SQLite on the other hand would be better for storing data where there is a large set of items, such as song titles in a music library which need to be searched through.
sqlite packages offer a higher-performance alternative where source compatibility is not an issue. There is no file parsing and generating code to write and debug. Content can be accessed and updated using powerful SQL queries, greatly reducing the complexity of the application code.
Shared preferences allow you to store small amounts of primitive data as key/value pairs in a file on the device. To get a handle to a preference file, and to read, write, and manage preference data, use the SharedPreferences class.
Shared Preferences. Store private primitive data in key-value pairs. Internal Storage. Store private data on the device memory.
Shared Preferences is better for things like settings or small amounts of data. Data stored in the Shared Preferences is stored in key-value pairs. This makes retrieving the data simpler, but there is not a really efficient way to query/search for a specific piece of data.
The database is an implementation of SQLite. This is useful when there is a large amount of records to store that all have the same/similar fields. Since it is SQLite, you can write queries to get specific records from the tables.
I do not have as much experience saving to the file system for storage, so someone else will have to speak to that one.
Here is a link to another stackoverflow discussion that compares SQLite and Shared Preferences. Pros and Cons of SQLite and Shared Preferences, as well as to the Android Documentation that goes into more details about how each method works. http://developer.android.com/guide/topics/data/data-storage.html
Shared Preferences
Store private primitive data in key-value pairs.
Internal Storage
Store private data on the device memory.
External Storage
Store public data on the shared external storage.
SQLite Databases
Store structured data in a private database.
Network Connection
Store data on the web with your own network server.
as per official Website
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