opacapp / opacclient

[unmaintained] A Java client library and an Android app to access more than 1,000 public and scientific libraries from all over the world.
https://opacapp.net
MIT License
156 stars 61 forks source link

Enable Android backup mechanism #498

Open johan12345 opened 6 years ago

johan12345 commented 6 years ago

Since Android 6.0, backup of app data using Google Drive is really easy to implement as it's built into the system and, for most apps, works out of the box. However, we have set the allowBackup property in the manifest to false in this commit (in 2014, so even before Android 6 existed) so that it doesn't work. I don't know why we needed to set this to false. @raphaelm , any idea?

raphaelm commented 6 years ago

Does this still need to be enabled in the app somehow or is it only the allowBackup property? Formerly, IIRC, that property lead to automatically uploading that data in some cases. I don't think we're going to upload data (that might include passwords) to Google without explicit user consent.

johan12345 commented 6 years ago

By default it would backup all database and SharedPreferences contents when allowBackup is enabled. But we could restrict the data that is backed up (e.g. exclude the AccountDatabase and only backup the StarDatabase - though the app would need handle this when only the favorites lists are restored and not the corresponding accounts) or make it configurable by implementing a BackupAgent and telling the system what files to backup there based on the user settings.

raphaelm commented 6 years ago

Agreed. But this answers why it is currently false ;)

I have a shady memory of starting to implement this and then stop, because there was only a way to specify files but no (documented, "guaranteed") way to the the filesystem location of a SQLite database… ;)

johan12345 commented 6 years ago

Agreed. But this answers why it is currently false ;)

Well, partly - at the time where you set it to false it would not have changed anything because only the old backup mechanism (that required you to implement a BackupAgent and only supported key-value storage) existed ;)

(background for this issue: someone sent us an e-mail that they lost their (large) favorites list that they filled for years because their phone broke and needed to be factory reset)