Is there any way to use the following code to take pictures automatically i.e. no button clicks at all. Just after sometime image can be taken automatically and stored on the SD card.
protected void startCameraActivity() {
Intent intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
intent.putExtra(MediaStore.EXTRA_OUTPUT,Uri.fromFile(new File(file_name)));
startActivityForResult(intent, 1);
finish();
}
You can use
Timer
&TimerTask
Class together for your requirement. Just study the following code and modify it according to your usage.No, once you start an Intent you really have no control over the Activity you start (assuming it's not one that you wrote yourself). In your case, you have to make your own Activity and use the Camera API.
Check out this tutorial:
http://marakana.com/forums/android/examples/39.html