Camera.CameraInfo cameraInfo = new Camera.CameraInfo(); int cameraCount = Camera.getNumberOfCameras(); for (int i = 0; i < cameraCount; i++) { Camera.getCameraInfo(i, cameraInfo); if (cameraInfo.facing == Camera.CameraInfo.CAMERA_FACING_FRONT) { // Do something if a front-facing camera is available } }In the above code, we first create a CameraInfo object which will hold the information about the camera. Then we get the number of cameras available on the device using the getNumberOfCameras() method. We then loop through each camera and get its info using the getCameraInfo() method. If a front-facing camera is found, we can do something with it. Package library: The method belongs to the android.hardware package library.