kiran boghra kiran boghra - 4 months ago 43
Android Question

front camera take very dark capture in android

I am taking photo capture using front camera using my custom camera app not using system camera app.But the captured photo is very dark so can see photo properly.

my code

mCamera = Camera.open(1);
Camera.Parameters params =mCamera.getParameters();
params.setSceneMode(Camera.Parameters.SCENE_MODE_NIGHT);
mCamera.setParameters(params);


And to take picture

if (mCamera != null) {
try {
mCamera.setPreviewDisplay(mSurfaceHolder);
mCamera.startPreview();
mCamera.takePicture(null, mPictureCallback,
mPictureCallback);
} catch (IOException e) {
e.printStackTrace();
}
}


Thanks in advance. Please give me suggestions. any help will be appreciated.

Answer

I have found following solution for this, And that worked for me

Wait for some time i.e. 500 ms before capture image using

mCamera.takePicture(null, mPictureCallback,mPictureCallback);