I am keeping some application meta data in SharedPreferences
. Whenever I uninstall the application and reinstall it, the SharedPreferences
are dele
You should add a BackupAgentHelper
to your app. Together with the SharedPreferenceBackupHelper
, it backups the SharedPreferences
to the cloud (if the device supports it). When the app is reinstalled the data is restored.
See:
BackupAgentHelper
SharedPreferenceHelper (contains all the code you need to implement it)
general Backup guide
As edthethird said: best lay physical files on device external storage and read them on installation. If the file content needs to be hidden from users just perform a simple encryption/decryption process.