Delete database when uninstall app

Asked

Viewed 1,293 times

2

In my app I create the database done in Sqlite in the folder:

System.Environment.Specialfolder.Personal

But on some devices (Android) when uninstalling the app it seems that the database continues in the folder, because when installing the app again it starts logged in and with the previously saved data.

Would anyone know why this occurs and how it could solve this problem?

  • Dude, I noticed this also only on an Asus device with Android 7. It seems to be a modification of the OS made by the manufacturer. Particularly found it very bad. It means that it is keeping other trash after that desisntalo. An alternative may be to set up a broadcast receiver for the uninstallation event (need to confirm if you have this, do not remember) and do the manual deletion of the bank

  • Yeah, but I think this is happening on an Android 6.0 that some of the owners of the company where I’m making app makes test. They suggested I do this android:allowBackup="false" in Androidmanifest.xml. Only I haven’t tested it yet.

  • I’ve noticed this too, by what I had noticed it happens when you have more than one user registered on mobile (guest user)

1 answer

0


From the Android Marshmallow there is a new Feature, where inside the <application> you must set a value for the attribute android:allowBackup.

In your case: android:allowBackup = false

Source: Android Developers

Be to allow the application to participate in the backup and restore infrastructure. If this attribute is set to false, no application backup or restore will ever run, even by a full system backup that would cause all application data to be saved via adb. The default value of this attribute is true.

  • Well, I made those modifications. Now it’s waiting for the tests. Thank you.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.