Not registered yet?
Register now! It is easy and done in 1 minute and gives you access to special discounts and much more!
When an app is uninstalled, is the data in its SharedPreferences database deleted?
If not, without a device being rooted, is there any way to clear that data? (Or at least view it?)
SharedPreferences are actually saved in a file in the app private directory:
When an app is installed this directory and file are automatically created. When an app is uninstalled this directory is deleted along with its parent /data/data/package_name UNLESS the app is uninstalled in order to update it.
From command line this is done using the flag -k or -r that is
adb uninstall -k package_name - Keep the data and cache directories around after removal
adb uninstall -k package_name
adb uninstall -r package_name - Reinstall an existing app, keeping its data
adb uninstall -r package_name
SharedPreferences database always deleted when app is uninstalled. but In Manifest
If allowBackup is true then data is not clear even if application is uninstall then install. so always keep allowBackup false when data do not want store.
Thank you. What is the best way to keep allowBackup as false?
@user298642 The allowBackup flag usually only affects the adb backup. Do you have a source that backs your answer?