I have in my application Android manifest:
android:allowBackup="true"
But in spite of using an Android 8 device the backup does not work until I manually put in the console:
adb shell bmgr backup @pm@ && adb shell bmgr run
and...
adb shell bmgr fullbackup <PACKAGE>
as says the Android developers guide to test a backup.
I have tested so many devices and when I put this in console it starts to work fine and I can uninstall and install the application from Google Play without losing the SharedPreferences. But if I don't write this in my Android Studio console with the device connected, the backup doesn't work.
It's strange because many other applications restore their data, so I think that the device settings are ok and I am missing something in the code.
This are my build.gradle sdk specifications
def valueMinSdkVersion = 15
def valueTargetSdkVersion = 28
Thank you so much.
Mauricio Güell