Starting with Android 10, users reported issues with backup and restore functionality, especially on Android 13, where they were unable to create or restore backups. This was due to changes in how external storage permissions are handled. More details can be found in the Android documentation.
To address this, I integrated the updated APIs that support saving and restoring local backups, ensuring compatibility from Android 5 (Lollipop) through the latest versions of Android.
How old backup/restore works
Previously, backups were only saved in a folder named OBABackups under the Android Documents directory. Users were unable to select a specific location to save backups. Additionally, the restore functionality was disabled until the app could verify whether the backup folder existed. This approach had limitations, such as when a user wanted to transfer a backup to a different phone and restore it without creating a new backup.
Users encountered unexpected errors when attempting to update an existing backup, making it possible to back up only once.
The functionality was completely broken on Android 13 and above.
The application used read and write external storage permissions, which may be a concern for users regarding privacy and security.
Backup was disabled if you don't have SD card
New Changes
Users can now take backup to any folder of their choice by default we will navigate the user to Documents directory
Users can restore backups from any location at any time.
Functionality has been tested and works perfectly on Android 7 (Nougat), Android 10, Android 11, Android 13, and Android 14.
Removed read and write external storage permissions to address privacy and security concerns.
Completely rely on the Android UI file picker to ensure compatibility without requiring additional permissions.
[x] Apply the AndroidStyle.xml style template to your code in Android Studio.
[x] Run the unit tests with gradlew connectedObaGoogleDebugAndroidTest to make sure you didn't break anything
[x] If you have multiple commits please combine them into one commit by squashing them for the initial submission of the pull request. When addressing comments on a pull request, please push a new commit per comment when possible (reviewers will squash and merge using GitHub merge tool)
Fixes #1212
Details
Starting with Android 10, users reported issues with backup and restore functionality, especially on Android 13, where they were unable to create or restore backups. This was due to changes in how external storage permissions are handled. More details can be found in the Android documentation.
To address this, I integrated the updated APIs that support saving and restoring local backups, ensuring compatibility from Android 5 (Lollipop) through the latest versions of Android.
How old backup/restore works
New Changes
Documents directory
Main Changes
Video
https://github.com/user-attachments/assets/6faf68c4-82b1-44e2-a77a-71e624d3db1f
TODO
[x] Apply the
AndroidStyle.xml
style template to your code in Android Studio.[x] Run the unit tests with
gradlew connectedObaGoogleDebugAndroidTest
to make sure you didn't break anything[x] If you have multiple commits please combine them into one commit by squashing them for the initial submission of the pull request. When addressing comments on a pull request, please push a new commit per comment when possible (reviewers will squash and merge using GitHub merge tool)