Skip to content Skip to sidebar Skip to footer

How To Take Picture From Front Camera In Android2.2

can anybody tell How to take picture from front camera in android2.2 can anybody provide sample code Thanks

Solution 1:

You should use the Camera API with the right camera index:

Cameracamera= Camera.open();
Camera.Parametersparameters= camera .getParameters();
parameters.set("camera-id", 2);
camera .setParameters(parameters);

Don't forget to set the permissions correctly:

<uses-featureandroid:name="android.hardware.camera" /><uses-permissionandroid:name="android.permission.CAMERA" />

Please note that in most cases it will be camera #2, maybe there is another automatic way to find out. You try this one for now. If I'll find something automatic I'll update the post.

And you can take the complete code from here (just replace the Camera.open): Camera Tutorial

Post a Comment for "How To Take Picture From Front Camera In Android2.2"