Hi I could not find any thread on stackoverflow regarding difference between GCMNetworkManager and JobScheduler in Android.
Can anyone help me for this.
Both do the same thing, the difference is when you can use or the other.
JobSchedulerwas introduced on API 21 as part of the Android framework. If your app minimum API level is 21, you should use this one.
GCMNetworkManageris 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.
The single solution for scheduling background work is now WorkManager: https://developer.android.com/topic/libraries/architecture/workmanager
Under the hood, WorkManager detects what API level your app is running on and uses JobScheduler (for API 23+) or AlarmManager + BroadcastReceiver (for API 14-22).
Uses JobScheduler for API 23+
Uses a custom AlarmManager + BroadcastReceiver implementation for API 14-22