Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Does Android JobScheduler or GCM JobScheduler persist jobs after an app update?

Tags:

android

I know that both Android native (Post Lollipop) JobScheduler and GCM JobScheduler can persist jobs after a reboot, but what about after an app update? Will I still get the job invoked after the app is updated?

Thanks

like image 541
user1603602 Avatar asked Aug 20 '15 01:08

user1603602


People also ask

What is the use of JobScheduler in Android?

This is an API for scheduling various types of jobs against the framework that will be executed in your application's own process. See JobInfo for more description of the types of jobs that can be run and how to construct them.

Which API is used to schedule Android jobs?

The job scheduler API. The Android 5.0 Lollipop (API 21) release introduces a job scheduler API via the JobScheduler class. This API allows to batch jobs when the device has more resources available. In general this API can be used to schedule everything that is not time critical for the user.


1 Answers

Regarding GCM Network Manager:

When Google Play Services or the client app is updated, all scheduled tasks will be removed. GcmNetworkManager invokes the client app’s onInitializeTasks(). Override this function to reschedule necessary tasks.

https://developers.google.com/cloud-messaging/network-manager

I have yet to find a similar requirement for JobScheduler.

like image 78
seanjfarrell Avatar answered Sep 18 '22 23:09

seanjfarrell