Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migrate from JobScheduler to WorkManager #329

Open
firebirdberlin opened this issue May 25, 2022 · 0 comments
Open

Migrate from JobScheduler to WorkManager #329

firebirdberlin opened this issue May 25, 2022 · 0 comments
Labels

Comments

@firebirdberlin
Copy link
Owner

Swiping to skip an upcoming alarm is not supported on Android below api level 21 / LOLLIPOP.

In skipAlarm code relying on JobScheduler/JobService is intentionally not executed on earlier Android versions:
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.LOLLIPOP [....]

Android recommends using WorkManager as a replacement to JobScheduler/JobService.

Using WorkManager, the app would be compatible with all Android versions from api level 14, with additional advantages:

https://tedblob.com/android-workmanager-vs-jobscheduler/

Android WorkManager benefits over JobScheduler

The major advantage of using WorkManageris that it helps to build battery-friendly apps. Besides battery optimization, it also has several other key benefits:
Simpler and consistent API
Works back to API level 14
Works even without google play service. For example, FirebaseJobScheduler requires google play to schedule the Job.
Persist scheduled work across app updates and device restarts
Ability to observe Job status
Define the conditions for your work to run using Work Constraints. (For example: run only when your device is idle)
Allows you to schedule work to run either onetime or repeatedly
Provides flexible retry mechanism
Allows to configure exponential back-off
Can integrate seamlessly with RxJava and Coroutines
Flexibility to plug custom asynchronous APIs.
Chain multiple dependent tasks together and also defines the order to run
Improves app startup time and also reduces crash rate.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant