3

I am creating a alarm like application where user can add a remainder for particular date and time, they can also choose repeat to repeat the remainder.

And I don't do any network specific job in remainder. But in future I may need to use the network specific job, but so far its not needed right now.

Which one is better for my requirement AlarmManager or Firebase JobDispatcher ?

Phantômaxx
  • 37,901
  • 21
  • 84
  • 115
Encipherer
  • 411
  • 7
  • 23

1 Answers1

3

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)

Sahil Patel
  • 684
  • 7
  • 19
  • Seems FirebaseJobDispatcher has "Google play services" dependency. So I am thinking to use evernote/android-job. Can I use this? Also let me know whether all the android device has "Google Play Services" installed? If yes, then I can go with FJD. – Gvtha Mar 18 '18 at 06:18
  • I think it's completely all right to assume that every phone has google play services installed. Everything from location services to Google Pay or Google wear requires google play services. Maybe some Android variants for Chinese markets might not be using it but I think majority of devices have it. – Sahil Patel Mar 18 '18 at 15:50
  • If you look at https://github.com/firebase/firebase-jobdispatcher-android/issues I'm doubt it is production ready (latest version 0.8.5). I switched from AlarmManager to Firebase Job Dispatcher and reliability significantly decreased on Samsung phones. – Tomáš Hubálek Apr 17 '18 at 14:26
  • At this point, I suppose WorkManager is the correct alternative to both. – Martin Marconcini Mar 14 '19 at 19:58