0

I would like my Android app to give the user the ability to capture multiple photos at once.

Currently, from what I can tell, Android does not support this behavior natively, and an INTENT_ACTION_STILL_IMAGE_CAMERA along with a ContentObserver is not reliable enough in my situation.

Can you please recommend me of a third-party library which supports capturing multiple photos at once?

By "at once" I mean - without having to create an Intent and startActivityForResult() for capturing each photo.

1

2 Answers 2

1

You can call ACTION_IMAGE_CAPTURE intent for capturing the images through device camera. For 'n' no. of photos, call the intent 'n' number of times.

This is useful if you want the user to take a fixed number of photos, you can refer the answer given here.

Alternatively you can also use INTENT_ACTION_STILL_IMAGE_CAMERA intent for keeping the camera in still mode, so that the user can take as much pictures as they want.

In the code given below, activity that launches the camera will be in still image mode & it does not exit until the user is finished the activity.

protected void onActivityResult(int requestCode, int resultCode, Intent data){  

               if (requestCode == CAMERA_REQUEST && resultCode ==Activity.RESULT_OK) {  
                   Intent cameraIntent = new Intent(MediaStore.INTENT_ACTION_STILL_IMAGE_CAMERA);
                   this.startActivity(cameraIntent);
                } 
}

Nota bene: I'm giving posting this solution for other people who are having this question, the OP end-up writing their own solution but chose not to post the solution due to their company's 'proprietary code'. OP, please refer this faq.

0
-3

I ended up writing my own CameraActivity, by customizing Camera2Basic example by Google.

2
  • @alcor Sorry, but It is a part of an application which I sell to a company. Did you check Camera2Basic? Commented Apr 1, 2016 at 10:09
  • I see, thank anyway :) Yes, of course. I already wrote something to solve the same problem, but I wanted to have a double check :) Have a nice day!
    – alcor
    Commented Apr 1, 2016 at 10:14

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.