What is the difference between GCMNetworkManager and JobScheduler in Android

Both do the same thing, the difference is when you can use or the other.

  • JobScheduler was introduced on API 21 as part of the Android framework. If your app minimum API level is 21, you should use this one.

  • GCMNetworkManager is a "compat" version of it that is proocessed/executed via Google Play Services (so it works on device). If your app minimum API level is less than 21, you should use this one.

Also important to note, is that GCMNetworkManager have been replaced by FireBase JobDispatcher (https://github.com/firebase/firebase-jobdispatcher-android), so you shouldn't use GCMNetworkManager anymore and use this one instead.

Tags:

Android