title: How to set the exact time to android job for a daily job at fixed time?
body: <p>I am trying to schedule the job which will run at 10 PM daily.</p>
  
  <p>I tried to use the setExact method and provide the milliseconds by converting 22 hours to milliseconds and for testing I executed the app and changed the system time to 10 PM but the job did not execute.</p>
  
  <p>I also tried to give coming time so converted 12:45 to milliseconds and given to setExact method. But that also did not work.</p>
  
  <p>How can I set this and test?</p>
  
  <p>FileTrackJob</p>
  
  <pre><code>class FileTrackJob extends Job {
  
          static final String TAG = "FileTracking";
  
          @NonNull
          @Override
          protected Result onRunJob(Params params) {
  
              PendingIntent pendingIntent = PendingIntent.getActivity(getContext(), 0,
                      new Intent(getContext(), MainActivity.class), 0);
  
              Calendar cal = Calendar.getInstance();
              Date currentLocalTime = cal.getTime();
              DateFormat date = new SimpleDateFormat("HH:mm a");
      // you can get seconds by adding  "...:ss" to it
              String localTime = date.format(currentLocalTime);
  
              Notification notification = new NotificationCompat.Builder(getContext())
                      .setContentTitle("Android Job Demo")
                      .setContentText("Notification from Android Job Demo App. " + localTime)
                      .setAutoCancel(true)
                      .setContentIntent(pendingIntent)
                      .setSmallIcon(R.mipmap.ic_launcher)
                      .setShowWhen(true)
                      .setColor(Color.RED)
                      .setLocalOnly(true)
                      .build();
  
              NotificationManagerCompat.from(getContext())
                      .notify(new Random().nextInt(), notification);
  
  
              return Result.SUCCESS;
          }
  
          static void scheduleNoti() {
              new JobRequest.Builder(TrackingJob.TAG)
                      //  .setPeriodic(TimeUnit.MINUTES.toMillis(15), TimeUnit.MINUTES.toMillis(15))
                      .setExact(44820000)
                      .setUpdateCurrent(true)
                      .setPersisted(true)
                      .build()
                      .schedule();
          }
      }
  </code></pre>
  
  <p>MainActivity </p>
  
  <pre><code>FileTrackJob.scheduleNoti();
  </code></pre>
  
  <p>MainApp</p>
  
  <pre><code>public class MainApp extends Application {
  
      @Override
      public void onCreate() {
          super.onCreate();
  
          JobManager.create(this).addJobCreator(new DemoJobCreator());
      }
  }
  </code></pre>
  
  <p>DemoJobCreator</p>
  
  <pre><code>class DemoJobCreator implements JobCreator {
  
      @Override
      public Job create(String tag) {
          switch (tag) {
              case TrackingJob.TAG:
                  return new TrackingJob();
  
              case FileTrackJob.TAG:
                  return new FileTrackJob();
              default:
                  return null;
          }
      }
  }
  </code></pre>
  
  <p>Also I have scheduled one periodic job, this job is not working on some devices like red mi,on one samsung device its not repeated but on moto g4 plus it worked well.</p>
  
  <pre><code>class TrackingJob extends Job {
  
      static final String TAG = "tracking";
  
      @NonNull
      @Override
      protected Result onRunJob(Params params) {
  
          Intent pi = new Intent(getContext(), GetLocationService.class);
          getContext().startService(pi);
  
  
          return Result.SUCCESS;
      }
  
      static void schedulePeriodic() {
          new JobRequest.Builder(TrackingJob.TAG)
                  .setPeriodic(TimeUnit.MINUTES.toMillis(15), TimeUnit.MINUTES.toMillis(15))
                  .setUpdateCurrent(true)
                  .setPersisted(true)
                  .build()
                  .schedule();
      }
  }
  </code></pre>
  
  <p>Can anyone help with this please? Thank you..</p>