Android provides following options for data storage:
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.
Cache - Cache data during application is running.(May be clear on shortage of space)
What I was wondering is the life time of these storage.
An extension to this question is, using which storage my data is more secure in terms of loss and in terms of access by unauthorized resources (users, applications in case of root).
Which storage(s) clears on application close (Obviously cache)
Cache
Which storage(s) clears on application re-install
Cache
Which storage(s) clears on application update
Cache
Which storage(s) clears on application un-install
Cache, SQLite, Shared Preferences
Which storage(s) clears on application clear data
Cache, SQLite, Shared Preferences
Which storage(s) clears on mobile factory reset
It clears all, but not External Storage data
An extension to this question is, using which storage my data is more secure in terms of loss and in terms of access by unauthorized resources (users, applications in case of root).
It is best to store the data in the SQLite in the encrypted form. If your device is rooted then it means you can access even the SQLite.
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