title: How to check liveness in face detection in android face detection
body: <p>I am creating one android app for attendance system, in which I'll capture the pic as soon as I detect the face. I am able to achieve this but with only one issue, this system can be faked with the photo of employee because there is no liveness check right now. </p>
  
  <pre><code>mCamera.setFaceDetectionListener(new Camera.FaceDetectionListener(){
      @Override
      public void onFaceDetection(final Camera.Face[]faces,Camera camera){
          if(faces!=null&amp;&amp;faces.length&gt;0){
              try{
                  if(lastCaptureTiume+10000&lt;=System.currentTimeMillis()){
  
                      mCamera.takePicture(null,null,jpegCallback);
                      lastCaptureTiume=System.currentTimeMillis();
                  }
              }
              catch(Exception e)
              {
              }
          }
      });
  }
  </code></pre>
  
  <p>On jpegCallback I am checking the face and cropping it for further process. </p>
  
  <p>I searched for some samples for liveness but no luck, If anybody knows how I can implement liveness please help.</p>