Skip to content Skip to sidebar Skip to footer

Android Jobscheduler. Can I Schedule Job Every 15 Seconds

My code is work. But I'm not sure that this will work on all devices and always. Can I use JobScheduler like this? Start method: public static void schedule() { JobScheduler sc

Solution 1:

Can I schedule job every 15 seconds

No. Minimum duration between two schedule is around 15 minutes. You can easily query for this information using getMinPeriodMillis()

Note:

Attempting to declare a smaller period that this when scheduling a job will result in a job that is still periodic, but will run with this effective period.

For setMinimumLatency, based on the documentation:

Milliseconds before which this job will not be considered for execution.

This doesn't mean the job will be executed immediately after 15 seconds and won't be reliable from Android N when first phase of doze mode kicks in.

Post a Comment for "Android Jobscheduler. Can I Schedule Job Every 15 Seconds"