By RockPaperLizard


2019-06-12 20:18:36 8 Comments

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?)

2 comments

@Gogu CelMare 2019-06-14 06:21:10

SharedPreferences are actually saved in a file in the app private directory: /data/data/package_name/shared_prefs/somefilename.xml

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 direct­ories around after removal

adb uninstall -r package_name - Reinstall an existing app, keeping its data

@User123 2019-06-14 05:06:33

SharedPreferences database always deleted when app is uninstalled. but In Manifest
android:allowBackup="true" 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.

@RockPaperLizard 2019-06-14 06:35:29

Thank you. What is the best way to keep allowBackup as false?

@Robert 2019-06-14 19:57:44

@user298642 The allowBackup flag usually only affects the adb backup. Do you have a source that backs your answer?

Related Questions

Sponsored Content

2 Answered Questions

[SOLVED] How can I access veryfit app database on my device?

1 Answered Questions

[SOLVED] Is there a way to see when the last time an uninstalled app was installed?

  • 2018-05-31 22:49:23
  • user264554
  • 157 View
  • 1 Score
  • 1 Answer
  • Tags:   applications

3 Answered Questions

[SOLVED] Can I build an APK from an installed app and its data?

4 Answered Questions

[SOLVED] Prevent apps being uninstalled

2 Answered Questions

[SOLVED] History of installed/uninstalled apps

2 Answered Questions

1 Answered Questions

0 Answered Questions

How to set an app to use its native language?

3 Answered Questions

[SOLVED] Is the data associated with an app cleared when an app is uninstalled?

1 Answered Questions

Sponsored Content