Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to take multiple photos before dismissing camera intent?

Tags:

android

camera

I am trying to take multiple photos using the default device camera application launched through an intent (MediaStore.ACTION_IMAGE_CAPTURE). With the devices I am testing with, the camera launches, takes a picture, asks for confirmation, then returns to my activity where I process the result.

I've considered using broadcast receiver callbacks or a content observer; however, I cannot find a way to launch the camera and keep it active until the user is finished. If possible, I wish to avoid developing a custom camera application.

The reason I must do this is because users commonly need to take multiple photos in succession, and on some devices the camera start-up time is upwards of 5 seconds, and the users using the software take 10 - 30 photos consecutively; not only that, but they need control over various camera parameters.

Is there a way to launch the camera intent and only return to my activity once the user exits the camera application?

like image 512
Chris Hutchinson Avatar asked Dec 27 '11 17:12

Chris Hutchinson


1 Answers

I discovered through the SDK documentation that there's an alternative intent action for the device camera that launches the camera in still image mode and does not exit until the user is finished with the activity:

Intent intent = new Intent(
    MediaStore.INTENT_ACTION_STILL_IMAGE_CAMERA);
this.startActivity(intent);

Coupled with a ContentObserver this was exactly what I needed to accomplish.

like image 156
Chris Hutchinson Avatar answered Oct 22 '22 17:10

Chris Hutchinson