Scope: Hi, I am developing a Service in Android API. I need this Service for running whole time (while device is running), so receiver for BOOT
android.intent.action.BOOT_COMPLETED
was setup and Service is scheduled by AlarmManager every 10 minutes.
Problem: My OS got some updates and after updating, it kill my service, unschedule Service from AlarmManager. And as far as I do not reboot my device, Service is not started/scheduled.
Question: Is there any event for receivers, that OS is restarted but device is not? Or updates are installed, OS is resumed etc.?
EDIT
Hello, thanks for links and advice.
Nowadays, I'm using library Evernote for scheduling background jobs.
see https://github.com/evernote/android-job
I accepted the truth, that long-living Service is antipattern and BOOT broadcast can be tricky. As result, I used Evernote to schedule simple jobs to repeatly "do my needs". It nice works as expected, resumes after device restart & is compatible with "Android alarm planning" management.
Just a great library.