package com.example.patrice.job_scheduler_04;

import android.app.job.JobInfo;
import android.content.ComponentName;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;

public class MainActivity extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

       // ComponentName componentName = new ComponentName(getApplicationContext(),TestService.class);
      //  JobInfo jobInfo =  new JobInfo.Builder(1,componentName).setMinimumLatency(1000).build();

        // 12 heures     60*60*12*1000
        // 10 sec = 10000ms

        ComponentName componentName = new ComponentName(getApplicationContext(), TestService.class);
        JobInfo jobInfo = new JobInfo.Builder(1, componentName).setPeriodic(10000)
                .setRequiredNetworkType(JobInfo.NETWORK_TYPE_ANY).setRequiresCharging(false).build();

    }
}
