Firebase Jobdispatcher - How Does It Work Compared to Previous APIs (Jobscheduler and Gcmtaskservice)

Confused in choosing between Firebase JobDispatcher vs AlarmManager

Don't be confused. AlarmManager API has some significant flaws with accuracy (Setting a task to start at a particular time in future). It has been accepted by Google. When you try to use alarm manager, it shows a warning about it's inaccuracy. Go with FirebaseJobDispatcher. It was created to replace AlarmManager. This is what you need 99% of the times when you need to schedule some operation for some other time (or repeat at certain time interval)

Firebase Job Dispatcher interval between jobs increases over time

This is due to your

.setRetryStrategy(RetryStrategy.DEFAULT_LINEAR)

If you have a look at this file https://github.com/firebase/firebase-jobdispatcher-android/blob/master/jobdispatcher/src/main/java/com/firebase/jobdispatcher/RetryStrategy.java
its is evident that the retry statergy increases linearly in

/** Expected schedule is: [30s, 60s, 90s, 120s, ..., 3600s] */

You can try creating your own custom retry policy by following the link below

https://github.com/firebase/firebase-jobdispatcher-android/issues/179

Does Firebase Job dispatcher needs internet access for scheduling job?

when you use .setConstraints(Constraint.ON_ANY_NETWORK) the job will be executed when there is any type of network connection, You can choose between none, any and unmetered (Wifi), by default it's NONE so just delete the setConstraints



Related Topics



Leave a reply



Submit