PassiveFaceCaptureActivity

This activity is used to scan the user's face using a Passive Face Capture Session.

Constructors

Types

Link copied to clipboard
public class Companion

Properties

Link copied to clipboard
private Camera camera

The camera object

Link copied to clipboard
private ListenableFuture<ProcessCameraProvider> cameraProviderFuture

The future for the camera provider

Link copied to clipboard

The capture analyzer. This processes the frames from the camera

Link copied to clipboard
Link copied to clipboard
public final static String EXTRA_CHECK_LIVENESS

Intent extra to indicate that liveness check is required

Link copied to clipboard
public final static String EXTRA_PASSWORD

Intent extra for password

Link copied to clipboard
public final static String EXTRA_QR_CODE_BYTES

Intent extra for QR code data

Link copied to clipboard
public final static String EXTRA_RETURN_IMG_BYTES

Intent extra to indicate that just the image bytes should be returned

Link copied to clipboard

The frame layout showing the pinch to zoom animation

Link copied to clipboard

The Oval overlay view to show the face oval where the user is supposed to align their face

Link copied to clipboard

Whether the pinch to zoom hint has been shown (it is only shown once)

Link copied to clipboard
private ImageView ivBack

The button to go back to the previous screen

Link copied to clipboard

The preview view for the camera

Link copied to clipboard
private PassiveFaceCaptureSession session

Passive Face Capture Session

Link copied to clipboard

The text view to show instructions to the user

Functions

Link copied to clipboard
private final Unit bindPreview(ProcessCameraProvider cameraProvider)

This method is used to bind the camera preview and make the capture analyzer process the frames from the camera. When called, this method will also create a new session and reset the UI. Any exception from the SDK will be caught and shown in the UI.

Link copied to clipboard
private final Unit checkFaceLivenessFace()

Called liveness check after the face capture session is complete

Link copied to clipboard
private final Camera getCamera()

The camera object

Link copied to clipboard
private final ListenableFuture<ProcessCameraProvider> getCameraProviderFuture()

The future for the camera provider

Link copied to clipboard

The capture analyzer. This processes the frames from the camera

Link copied to clipboard
private final FrameLayout getFlPinchToZoom()

The frame layout showing the pinch to zoom animation

Link copied to clipboard

The Oval overlay view to show the face oval where the user is supposed to align their face

Link copied to clipboard
private final ImageView getIvBack()

The button to go back to the previous screen

Link copied to clipboard
private final PreviewView getPvCamera()

The preview view for the camera

Link copied to clipboard
private final PassiveFaceCaptureSession getSession()

Passive Face Capture Session

Link copied to clipboard
private final TextView getTvInstructions()

The text view to show instructions to the user

Link copied to clipboard
private final Unit hidePinchToZoomHint()

This method is used to hide the pinch to zoom hint.

Link copied to clipboard

Whether the pinch to zoom hint has been shown (it is only shown once)

Link copied to clipboard
protected Unit onCreate(Bundle savedInstanceState)
Link copied to clipboard
private final Unit onFaceCaptureCompleted()

Move to the next activity when the face capture session is complete

Link copied to clipboard

This method is used to notify the listener that the first frame has been captured.

Link copied to clipboard
protected Unit onPause()
Link copied to clipboard
public Unit onProcessingError(SenseCryptSdkException exception)

Called when there is an error while processing a frame

Link copied to clipboard
public Unit onProcessingResultAvailable(PassiveFaceCaptureProcessingResult result)

This method is used to process the pose of the user's face based on the current frame.

Link copied to clipboard
protected Unit onResume()
Link copied to clipboard
private final Unit resetSession()

Reset the session

Link copied to clipboard
private final Unit setCamera(Camera camera)

The camera object

Link copied to clipboard
private final Unit setCameraProviderFuture(ListenableFuture<ProcessCameraProvider> cameraProviderFuture)

The future for the camera provider

Link copied to clipboard
private final Unit setCaptureAnalyzer(PassiveFaceCaptureAnalyzer captureAnalyzer)

The capture analyzer. This processes the frames from the camera

Link copied to clipboard
private final Unit setFlPinchToZoom(FrameLayout flPinchToZoom)

The frame layout showing the pinch to zoom animation

Link copied to clipboard
private final Unit setFroOverlay(FaceOvalOverlayView froOverlay)

The Oval overlay view to show the face oval where the user is supposed to align their face

Link copied to clipboard
private final Unit setIvBack(ImageView ivBack)

The button to go back to the previous screen

Link copied to clipboard
private final Unit setPinchToZoomHintShown(Boolean isPinchToZoomHintShown)

Whether the pinch to zoom hint has been shown (it is only shown once)

Link copied to clipboard
private final Unit setPvCamera(PreviewView pvCamera)

The preview view for the camera

Link copied to clipboard
private final Unit setSession(PassiveFaceCaptureSession session)

Passive Face Capture Session

Link copied to clipboard
private final Unit setTvInstructions(TextView tvInstructions)

The text view to show instructions to the user

Link copied to clipboard
private final Unit setupComponents()

This method is used to set up the components in this activity.

Link copied to clipboard
private final Unit setUpListeners()

This method is used to set up the listeners for the components in this activity.

Link copied to clipboard

Set up the tap to focus and pinch to zoom

Link copied to clipboard
private final Unit showErrorDialog(SenseCryptSdkException error)

Show an error dialog to the user. It handles SenseCryptSdkException.LivenessFailed, SenseCryptSdkException.ExtremeHeadPoseDetected, and SenseCryptSdkException.CaptureSessionTimeOut via the UIHelper methods while leaving other errors to be handled by showGeneralErrorDialog.

Link copied to clipboard
private final Unit showErrorInUIThread(SenseCryptSdkException error)

This method is used to show an error in the UI thread

Link copied to clipboard
private final Unit showGeneralErrorDialog(SenseCryptSdkException error)

Show general error dialog

Link copied to clipboard
private final Unit showPinchToZoomHint()

This method is used to show the pinch to zoom hint.

Link copied to clipboard
private final Unit startCamera()

Start the camera