Hi all,
If my app does an automatic backup to the cloud, what's the best timing to run the backup process?
Long version:
I'm adding an automatic backup to some of my apps (so that users can restore later if data gets corrupted or if they just want to revert to an earlier state).
The backup would copy the data files (small text files) to the user's Google Drive using the Drive API (after they give initial permission).
I do an automatic local save on the Pause event, but because the backup is a cloud operation, it may take several seconds to complete, so I'm guessing that I won't get enough time at Pause to do this (before Android shuts down the app process).
Could I use a service to do the backup, and trigger it at Pause?
Or would I need to wake up a service periodically (e.g. once a day) to look for changes and do the backups as needed?
Any tips appreciated!
If my app does an automatic backup to the cloud, what's the best timing to run the backup process?
Long version:
I'm adding an automatic backup to some of my apps (so that users can restore later if data gets corrupted or if they just want to revert to an earlier state).
The backup would copy the data files (small text files) to the user's Google Drive using the Drive API (after they give initial permission).
I do an automatic local save on the Pause event, but because the backup is a cloud operation, it may take several seconds to complete, so I'm guessing that I won't get enough time at Pause to do this (before Android shuts down the app process).
Could I use a service to do the backup, and trigger it at Pause?
Or would I need to wake up a service periodically (e.g. once a day) to look for changes and do the backups as needed?
Any tips appreciated!
Last edited: