jberkel / sms-backup-plus

Backup Android SMS, MMS and call log to Gmail / Gcal / IMAP
https://play.google.com/store/apps/details?id=com.zegoggles.smssync
Apache License 2.0
1.81k stars 498 forks source link

Use SyncManager/JobManager to run backups in the background #572

Open jberkel opened 9 years ago

jberkel commented 9 years ago

Should work more reliably than existing solution.

MilanKerslager commented 6 years ago

I've got error notification after a day without backup even I'm using data/Internet access through whole day (only unlimited mobile data). If backup fails, is it possible to reschedule backup few seconds/minutes later (after data connection become stable)? 1.5.11-beta12

sms_backup_plus.log

ecuamami commented 6 years ago

how is everyone getting the 1.5.11 beta version? what do i look for in app store to download?

MilanKerslager commented 6 years ago

@ecuamami go and read/join at main page of the project here at https://github.com/jberkel/sms-backup-plus

coderonline commented 6 years ago

Is it possible that automatic backup is greyed out together with OAUTH? I am using 1.5.11-beta7 from the f-droid store on the lineageos based on android 7.1.2 and I am NOT using the built-in data saver, manual backups work fine, but the option greyed out for me.

jberkel commented 6 years ago

@coderonline I think this has been fixed in one of the newer betas. f-droid is a bit behind, I'll try to update it.

in the meantime you could install the APK via https://github.com/jberkel/sms-backup-plus/releases

update: F-Droid now has a version with a fix

fezzzza commented 6 years ago

It seems to me that AutoBackup fails every time the app is updated from the Play Store, which prompts the "about" screen to update the user on the latest bug fixes etc. No functionality will resume before the "about" screen is dismissed. Could it be that doing away with the automatic pop-up of the "about" screen will allow the backups to continue in the background, or should I post a separate bug?

jberkel commented 6 years ago

@fezzzza could you explain a bit more? so you have the beta installed, auto backup works fine, a new update is installed (automatically in the background), automatic backups stop working until you manually launch the app and dismiss the screen?

It could be that the app gets classified as "never used" after install which means it is exempted from accessing certain resources in the background (App Standby).

I'm not sure what to do about it, since users normally don't need to interact with the app. It could either periodically sent a notification (after a successful backup), or get explicitly whitelisted by the user.

if it's just between app updates it's not a big problem since regular (i.e. non-beta) updates don't happen that often.

Billy4130 commented 6 years ago

I'm not sure that I have the exact same error but I have experienced something very similar (and just did this morning actually)

On Sun, Mar 25, 2018, 9:00 AM Jan Berkel notifications@github.com wrote:

@fezzzza https://github.com/fezzzza could you explain a bit more? so you have the beta installed, auto backup works fine, a new update is installed (automatically in the background), automatic backups stop working until you manually launch the app and dismiss the screen?

It could be that the app gets classified as "never used" after install which means it is exempted from accessing certain resources in the background (App Standby https://developer.android.com/training/monitoring-device-state/doze-standby.html#understand_app_standby ).

I'm not sure what to do about it, since users normally don't need to interact with the app. It could either periodically sent a notification (after a successful backup), or get explicitly whitelisted by the user.

if it's just between app updates it's not a big problem since regular (i.e. non-beta) updates don't happen that often.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/jberkel/sms-backup-plus/issues/572#issuecomment-375968834, or mute the thread https://github.com/notifications/unsubscribe-auth/AdWaNr9NKbRRw3mGtySs0jLk4O2jo333ks5th5TygaJpZM4FZ3LM .

MilanKerslager commented 6 years ago

Same problem here. I check it out. About screen pops up, I had last successful update 3/23. And last beta version update was 2 days ago (3/23). Samsung Galaxy S7, Android 7.0 (2/1/2018), SMS Backup+ 1.5.11-beta17

fezzzza commented 6 years ago

@jberkel I don't think I have the beta installed. I just installed the app from the Play Store. All I know is that Autobackup stops working periodically and when I check with the app, it prompts me with the about screen and tells me the last successful backup was x days ago. Clearing the "about" screen and doing a manual backup seems to allow autobackup to continue, but I haven't kept a close eye on how frequently the backups are. Perhaps adding a (possibly hidden and default=false) option "show notification on successful autobackup" would allow us to monitor when the app is working so that we can figure out the next step. Or how about an option to keep(and maybe even automatically send back to you) a circular log file of whenever autobackups are done? I'd want more detail than just that in the log. 1MB should be more than enough for a circular log and take up so little space on the beta users' phone - especially only when the user selects the (possibly hidden) option. I would suggest logging (even just among the beta group) is the key to pinpoint what is causing it, starting with pinpointing when it stops. Btw, I have Samsung Galaxy S7 edge, Android 7.0, and I'm a programmer who rambles a lot!!!

jberkel commented 6 years ago

@fezzzza the about screen should only show once (after an update). if not, you're very likely in the beta group (what's the version number displayed in about?). i'd suggest installing the beta since it has many fixes, esp. regarding auto backup.

fezzzza commented 6 years ago

@jberkel About shows v1.5.11 and I'm pretty sure the About page shows every time the app is launched after an auto-update

jberkel commented 6 years ago

@fezzzza 1.5.11 is the beta version, and it's normal that about is launched after updates (although it'll often display the same for betas)

jberkel commented 6 years ago

Here's a thing you could check when auto backup fails to run the next time: see if Android has deactivated the app (= App Standby). (do this before you launch SMS Backup+, as this will re-activate it)

  1. Go to Settings > About phone
  2. Scroll down and tap on the “Build number” option 7 times. After that, you should see “You are now a developer!”
  3. Go to Settings > System > Developer Options > Inactive apps (bottom of the list)

(steps 1 and 2 only need to be performed once)

See if SMS Backup+ is listed there as "Inactive" (see screenshot), and let me know if it is (just post to this thread)

screenshot_1522064128

fezzzza commented 6 years ago

Ok, I'll watch and wait for the next update and then experiment

Woi commented 6 years ago

I did launch SMS Backup+, but still no automatic backups. Neither after calls I made, nor the scheduled backup which should run every 6h. Samsung Galaxy S3 (i9300), LineageOS 14.1 for MicroG (Builddate 20180322), SMS Backup+ 1.5.11-BETA18, Battery optimization disabled for SMS Backup+

jberkel commented 6 years ago

@Woi can you check if the app is marked as "inactive"? contents of sync log?

Woi commented 6 years ago

The app is marked as active. Checked this with my device running for a while, as well as immediately after a reboot. Sync log contains absolutely no data regarding automatic backups. Only manual ones are listed (backupType=Manual). Detailed Log is enabled.

ghysla13 commented 5 years ago

Jan - I've received this notice regarding the SMS Backup+ app from Google/Gmail - is this being addressed?

"Hi,

Although you don’t need to do anything, we wanted to let you know that the following apps may no longer be able to access some data in your Google Account, including your Gmail content. If these apps are unable to meet the deadline to comply with our updated data policy requirements, they'll lose access to your Account starting July 15th, 2019. SMS Backup+

We are making this change as part of ongoing efforts to make sure your data is protected and private.

You can always view, manage and remove apps you’ve given access to your account by visiting your Google Account.

Thanks, The Google Accounts team"

-- Thanks again ~ Greta

MrUzagi commented 5 years ago

Jan - I've received this notice regarding the SMS Backup+ app from Google/Gmail - is this being addressed?

This is already adressed at length in #959.