Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android 5.0 JobScheduler API on earlier versions?

I'm building an Android application, which makes use of a manifest broadcast receiver to know when the device is plugged in. I think Android 5.0 JobScheduler API would be a much better way of doing this, but I have one question: is it possible to use this API or a similar one on earlier versions of Android? If it is not possible, what would be the best option to do this (instead of a manifest broadcast receiver)?

like image 814
fergaral Avatar asked Oct 18 '14 15:10

fergaral


Video Answer


2 Answers

Another option is this library: https://github.com/evernote/android-job

It uses the JobScheduler and GcmNetworkManager if possible. Otherwise it fallbacks to the AlarmManager. It also handles different API levels with the AlarmManager properly. This blog post gives you an overview.

(PS: I'm the main developer who worked on this library at Evernote. It's useful for our projects, that's why I wanted to share it here as well)

like image 192
vRallev Avatar answered Oct 02 '22 14:10

vRallev


Firebase JobDispatcher was introduced.

This replaces the old GCM Network Manager library.

like image 36
Mu-ik Jeon Avatar answered Oct 02 '22 16:10

Mu-ik Jeon