I want to make a app in which I have to open only front camera, How can i do it using intent?
private void captureImage() {
Intent intent =
Using Intent you open the standard android camera application.
Never use android.intent.extras.CAMERA_FACING property - this is an undocumented feature that stopped working starting from some of the android versions.
To open a front camera you should use Camera API - do things like choosing the front camera, showing a preview in a view, and taking pictures manually. Answer of @skydroid shows how to find the front camera. Note that Camera.open() doesn't open a camera for the user as you might expect, you should manually show the preview.
Also note, since API level 21 the Camera API is deprecated and docs recommend to use Camera 2 API instead. But Camera API remains fully functional and you have no other choice if you want support older versions (< API level 21) as well.