0

I need to create an app that with Appmobi or Phonegap that will be able to take an automatic picture with a time interval.

Is it possible to perform this?

I know hot to launch the camera with 30 seconds interval, but I need to launch the camera and take a picture. The device will be on a quadcopter, so no human interaction will be avalilable.

Gurpreet Singh
  • 20,907
  • 5
  • 44
  • 60
Iker Vázquez
  • 507
  • 3
  • 19
  • Possible duplicate of http://stackoverflow.com/questions/10603797/automatic-picture-capture-on-phonegap – hop Apr 20 '13 at 20:12

2 Answers2

0

I think you have to use camera.getPicture

function onSuccess(imageData) {
    var image = document.getElementById('myImage');
    image.src = "data:image/jpeg;base64," + imageData;
}

function onFail(message) {
    alert('Failed because: ' + message);
}

function getPicture(){
   navigator.camera.getPicture(onSuccess, onFail, { quality: 50 }); 
}

setInterval(getPicture, 30000);
Ozerich
  • 2,000
  • 1
  • 18
  • 25
  • Thanks, but this code do not automate the user click action on camera's button. I need to take pictures without user's interaction with a 30 seconds interval. – Iker Vázquez Apr 20 '13 at 20:26
  • @IkerVázquez This cannot be automated due to restrictions on devices. Imagine the security risks if this were possible. – Luke Taylor Jun 30 '16 at 14:57
-1

yes that is a automated one..with help of setInterval method the picture will taken for every 3 seconds..