As we discussed in a previous post, we had to remove support for Google Drive backups in version 2.6.1 due to changes originated by Google.
If that wasn’t enough, applications soon will not have the possibility to freely access the totality of a device’s storage. The generic permissions that gave full read and write access to the storage will be removed in Android Q.
This last change is perfectly understandable, as it will increase security and privacy for users. Any change that increases security is welcome.
However, this means that we must search for alternatives. So far in TimeTune, we requested read and write access to the device’s storage to make local backups and restores, create temporary files or pick custom sounds.
We need to change that, and we started with the backup/restore option.
After evaluating different possibilities, we decided to use the Storage Access Framework for backups. This is a tool provided by the Android system that works in a similar way to the native file picker in desktop systems. It allows users to access the available storage options using a standard interface.
The good news is that the Storage Access Framework includes… Google Drive! 🎉
Let’s see how this will work in TimeTune 2.6.2:
BACKUP/RESTORE IN TIMETUNE 2.6.2
The backup section in TimeTune’s settings will be very straightforward in version 2.6.2:
Clicking on ‘Backup database’ will open the system file picker, so you can select the destination for the backup file:
Clicking on ‘Restore database’ will open the same file picker, allowing you to choose the file to restore:
MULTIPLE BACKUP FILES
The new approach allowed us to add a new feature: the ability to create multiple backup files.
Instead of always saving your backups with the same name (‘timetune.db’ so far), the new backup names will include the date/time of the backup and the name of the source device.
TimeTune Backup (2019-05-14 103000) (Pixel 2)
This will allow you to:
- Create historical backups.
- Create different backups for different devices.
- Clearly see when a backup was created.
- Clearly see which device originated the backup.
PROS AND CONS
What do we gain and what do we lose with the new approach?
- The power is transferred to you, the user. You decide when and where to store your backups. This is what Google wants from applications.
- The app doesn’t need read or write storage permissions for backups anymore.
- The backup and restore options will use a standard system interface.
- You will be able to create multiple backup files.
- You will be able to save your backups in Google Drive.
- The new system doesn’t allow to make automatic backups. But again, this is what Google wants. It’s the user the one who must hold the power, not the app.
- If you create a lot of backups you may need to delete old backup files from time to time, to prevent file clutter.
The new approach for backups in TimeTune 2.6.2 certainly has powerful advantages, like the ability to access Google Drive again. It may not be a perfect solution, but it’s definitely better than the one we implemented in version 2.6.1.
However, remember that our intention is to implement automatic cloud synchronization with Cloud Firestore in a future version. We still have a long way to go. 👷♀️⚒