title: Android start running JobScheduler at specific time
body: <p>I want to start a JobScheduler at a specific time <strong>everyday</strong>, and finish it after 3 hours. </p>
  
  <p>I have the part of triggering the job every 20 min, and for 3 hours, but in JobInfo.Builder class there's no option for starting the job at an exact time.</p>
  
  <p>Going over the <a href="https://developer.android.com/reference/android/app/job/JobInfo.Builder.html" rel="noreferrer">JobInfo.Builder</a> class overview, there's nothing there that sets the time for starting a JobScheduler.</p>
  
  <p>Obviously, i don't want to run it for the whole day, and check that the time matches, this will drain more battery than needed, and is bad programing.</p>
  
  <p><strong>I was thinking of making an alarm to run at the time i specify and would trigger this job, but this seems to be a bit overkill.</strong> </p>
  
  <pre><code> JobInfo.Builder builder = new JobInfo.Builder(NIGHT_SYNC_JOB_ID, 
   new ComponentName(context, NightSyncDataJobService.class));
  
   //Job starts at 11pm, and ends at 2am. Running every 20 minutes.
   builder.setPersisted(true); //Job scheduled to work after reboot
   builder.setPeriodic(Consts.ONE_MINUTE * 20);
  
   JobScheduler jobScheduler = (JobScheduler) context.getSystemService(Context.JOB_SCHEDULER_SERVICE);
   jobScheduler.schedule(builder.build());
  </code></pre>
  
  <p>If you have any other solution to the issue, beside AlarmManger that triggers this JobScheduler, will be much appreciated. </p>