I am new on using job libraries as Job Scheduler. I have seen a lot of documentation and none of them responds to my question, is it possible to schedule a job for 9PM (for example) and that same job runs everyday at 9PM(the hour of the initial job). What I have seen are people setting a periodic time but I dont know if the periodic starts when the job runs for the first time our if I could specify an hour.
Asked
Active
Viewed 1,831 times
-1
-
Possible duplicate of [android schedule task to execute at specific time daily](https://stackoverflow.com/questions/38344220/job-scheduler-not-running-on-android-n) – PRATEEK BHARDWAJ Aug 22 '18 at 11:15
-
If you can see the post, he uses Alarm Manager. I want to know about Job Scheduler ;) – José Nobre Aug 22 '18 at 11:17
-
@jose check this https://stackoverflow.com/questions/38301351/android-start-running-jobscheduler-at-specific-time – AskNilesh Aug 22 '18 at 11:18
-
use alarm manager – Dr. aNdRO Aug 22 '18 at 11:22
1 Answers
1
Do you mean that you want to set exact, periodic job? If yes, it is not possible. Every periodic job is inexact. This mean that job will be executed at any time in a window of flex length at the end of the period. And the requirement is that the flex time is at least 5% of the period.
Take a look at: https://developer.android.com/reference/android/app/job/JobInfo.Builder.html#setPeriodic(long,%20long)
![](../../users/profiles/10259537.webp)
tomasznajda
- 46
- 3