Yes, the property name is usually obvious, but it's not working as expected.
<manifest ... >
...
<application android:allowBackup="true" ... >
...
</application>
I made a dumb Android app with a SQLite database to test this functionality. Supposedly with this property activated (and that is activated by default in API 23+) I can recover the database SQLite
once it is reinstalled on the Phone, since the database is hosted in the Google Drive of the user account of current google put.
Install and uninstall to test, but the results were not as expected. If I uninstall the app and reinstall it, the data is lost. If that same application is only reinstalled, the data remains.
How then can I make this property work? (by uninstalling it and reinstalling it can I recover the internal database of the application?)
From the official documentation:
In this case if you define in your
AndroidManifest.xml
:You define that when making a backup, your application will be included in it and when restoring it will be added to your device again.
It does not work when uninstalling the application and reinstalling it, it works when making a backup ("Backup") of your device, if you restore this copy again to your device the application will be included.
Hello, the attribute
android:allowBackup="true"
is used so that when a person makes a backup or a backup of their device, your application can be part of it, if you putfalse
and restore the phone, your app will be as if it had just been downloaded from the store.More info: https://developer.android.com/guide/topics/manifest/application-element