title: Android - How to take a picture based on a timer
body: <p>I want to implement a service where, specified a time of the day, the phone will take a picture automatically.</p>
  
  <p>Since now, I followed the official tutorial: </p>
  
  <pre><code>public class PhotoHandler {
  
  Activity a;
  
  public PhotoHandler(Activity a) {
      this.a = a;
  }
  
  public void takePicture() {
      Intent imageIntent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
      File imagesFolder = new File(Environment.getExternalStorageDirectory(), "MyITTTPictures");
      imagesFolder.mkdirs();
      String timeStamp = new SimpleDateFormat("yyyyMMdd_HHmmss").format(new Date());
      File image = new File(imagesFolder, timeStamp+".jpg");
      Uri uriSavedImage = Uri.fromFile(image);
      imageIntent.putExtra(MediaStore.EXTRA_OUTPUT, uriSavedImage);
      a.startActivityForResult(imageIntent, 0);
  }
  </code></pre>
  
  <p>}</p>
  
  <p>Starting my app I have control of my camera, but I have to take manually a picture; I want her to take a picture when the timer I set is out.
  Is there a way to make her do this automatically?</p>