Simple Android front camera face detection with a preview of the camera for the user
Explanatory tutorial can be found here: http://blog.blundell-apps.com/tut-front-camera-face-detection-with-preview/
Load your front facing camera like this
FrontCameraRetriever.retrieveFor(context);
Add a preview to your activity layout
SurfaceView cameraSurface = new CameraSurfaceView(context, camera, this);
((FrameLayout) findViewById(R.id.helloWorldCameraPreview)).addView(cameraSurface);
Listen for face detection like this
@Override
public void onFaceDetected() {
}
@Override
public void onFaceTimedOut() {
}
@Override
public void onFaceDetectionNonRecoverableError() {
}