Harshita
Harshita

Reputation: 392

How to take multiple images using camera in android

I need a camera that allows me take multiple pictures at once and then select one. Others may or may not be stored on the device. I've tried this. I can take multiple images but how to select one and use it in my app? I read the documentation related to camera2 but its hard to understand without any practical example.I also tried these, but an isolated snippet won't help. Any example related to the use of burst camera would help.

I do not expect a full code, but any directions on how to proceed? Is it possible to display the picture thumbnails as an when they are clicked on the camera screen itself. I'll need to have the bitmap of the image selected.

I can rephrase any part of the question if not clear.

Upvotes: 2

Views: 13825

Answers (2)

AskNilesh
AskNilesh

Reputation: 69671

Try this

you can Call your second startActivityForResult() from the onActivityResult() you get from your first startActivityForResult().

like this by this code you can get 10 pic

public int PIC_CODE=0;

protected void onActivityResult(int requestCode, int resultCode, Intent data) {  
    if (requestCode == CAMERA_REQUEST && resultCode == Activity.RESULT_OK) {  

        // get new image here like this
       if(PIC_CODE<10){
            // add new requset of picture like this
            Intent cameraIntent = new Intent(android.provider.MediaStore.ACTION_IMAGE_CAPTURE); 
            startActivityForResult(cameraIntent, CAMERA_REQUEST); 
            PIC_CODE++;
    }  
} 

Upvotes: 6

SripadRaj
SripadRaj

Reputation: 1735

You have to implement your own camera to take multiple pictures. Create a class with surface view and implements SurfaceView.Callback. Please check out my library which will implement the same.

https://github.com/SripadRaj/BurstCamera

Upvotes: 3

Related Questions