Questions tagged [android-jobscheduler]

Use this tag for questions related to the Android JobSchedule API for scheduling various types of jobs against the framework that will be executed in your application's own process.

Android JobScheduler is an API for scheduling various types of jobs against the framework that will be executed in your application's own process.

see the documentation for more info:

Android JobScheduler reference

558 questions
88
votes
7 answers

Android WorkManager vs JobScheduler

Why do we need the new Android WorkManager if we already have a JobScheduler along with a few nifty backports (AndroidJob and FirebaseJobDispatcher) with the same functionality? Does it have any killer-features or something? Because I don't see…
Nikolay Kulachenko
  • 4,604
  • 4
  • 31
  • 37
70
votes
1 answer

Firebase JobDispatcher - how does it work compared to previous APIs (JobScheduler and GcmTaskService)?

Background Google has multiple solutions for job/task scheduling, such as JobScheduler and GcmTaskService. Each has its own advantages and disadvantages. Recently, Google presented a new library called "Firebase JobDispatcher". The problem Sadly,…
66
votes
4 answers

What tools are available to test JobScheduler?

We're implementing a Job via JobScheduler for background loading of data. The job will fire about once a day. What tools are available for us to test this functionality (possibly ADB)? Use cases are to be able to simulate the conditions required for…
greg7gkb
  • 4,933
  • 4
  • 41
  • 55
54
votes
1 answer

JobScheduler: controlling delay from constraints being met to job being run

I'm using JobScheduler to schedule jobs. Mainly I'm using it for the .setRequiredNetworkType() method, which allows you to specify that you only want the job to be scheduled when a network connection (or more specifically an unmetered connection)…
drmrbrewer
  • 11,491
  • 21
  • 85
  • 181
47
votes
7 answers

Job Scheduler vs Background Service

I have an app which has a feature A which should run in background every minute. Feature A is that the app should connect to a database, read some data then get the current location of the device and based on them check a condition, if the condition…
47
votes
4 answers

Job Scheduler not running on Android N

Job Scheduler is working as expected on Android Marshmallow and Lollipop devices, but it is not running and Nexus 5x (Android N Preview). Code for scheduling the job ComponentName componentName = new ComponentName(MainActivity.this,…
Adil Bhatty
  • 17,190
  • 34
  • 81
  • 118
30
votes
2 answers

JobScheduler - How do I determine a unique Job ID?

According to the documentation, jobs must have a unique Job ID per uid. If I use a 3rd party library which also schedules jobs, does this mean I can't use the same Job ID as theirs? If so, how can I avoid these kind of collisions?
Ori Wasserman
  • 962
  • 1
  • 10
  • 24
26
votes
2 answers

How is JobIntentService related to JobService?

In case of Service and IntentService the main differences are Service runs on the main thread while IntentService is not, and the latter finishes itself when the work is done while we have to call either stopService() or stopSelf() to stop a…
justanoob
  • 1,797
  • 11
  • 27
24
votes
2 answers

Android JobScheduler executing several times

I am using the below code to create and schedule a job using Androids JobScheduler API: Log.d("hanif", "Scheduling periodic job 2 hrs with 20 mins backoff linear"); JobInfo jobInfo = new JobInfo.Builder(JOB_ID, new…
hanif
  • 664
  • 5
  • 8
22
votes
1 answer

JobScheduler JobService is started without Application

We converted our main Application class to Kotlin recently. Since then we are experiencing crashes, especially during the night (when our application was probably killed by the system), when our JobService is startet. We are accessing the…
marilion91
  • 2,094
  • 1
  • 19
  • 28
22
votes
6 answers

How to prevent auto-backup of an Android app?

I face very weird situation on certain device (Nexus 5x with Android 7): when I clean its data and uninstall it, then install it with Studio, the app is not unitialized but it uses data from 24th january! I tried the same procedure with a tablet and…
Leos Literak
  • 8,805
  • 19
  • 81
  • 156
21
votes
3 answers

Android java.lang.IllegalArgumentException: No such service ComponentInfo JobScheduler

I tried to create a simple JobScheduler job just to see how it works. but I keep getting this exception on runtime, I can't figure it out as I followed the guides step by step. This is my call: ComponentName componentName = new…
Roee N
  • 502
  • 2
  • 4
  • 17
21
votes
2 answers

Some questions about GcmTaskService

Background I wanted to use the new JobScheduler API that was presented on Lollipop, but sadly it doesn't have an official port for pre-Lollipop. However, there is the GcmTaskService, which provides very similar functionalities. The problem This API…
android developer
  • 114,585
  • 152
  • 739
  • 1,270
20
votes
6 answers

Android WorkManager api for running daily task in Background

I need to call one API daily in the background even if the app is closed. I have seen about WorkManager API. For my scenario, I tried PeriodicWorkRequest but unfortunately, it's not working as my expected result. What I did is I used this code in…
20
votes
1 answer

Android JobScheduler: If you schedule the same job with periodic time, does it start the period again?

What happens if I schedule the same periodic job (same job ID) and the Job has already been scheduled? Does it start its period again from the beginning? For example, I call this method twice: JobInfo myLongJob = new JobInfo.Builder( …
Juan Saravia
  • 7,661
  • 6
  • 29
  • 41
1
2 3
37 38