Android Integration

Overview

The Face Capture SDK comes with a JAVA interface for Android integration. This chapter will outline the requirements for Android integration, how to operate the included developer demo, and which parts of the demo source code correspond to the integration tasks outlined in the Application Design chapter.

Integration Requirements

The Face Capture SDK requires Camera permissions.

Demo Operation

The Face Capture SDK comes with a small developer demo that is intended to show how various options work. The demo allows developers to rapidly test various combinations of settings to determine what they need to adjust to meet their own application’s requirements. The demo is not intended to resemble a finished product and provides the user with many options that should not be accessible to an end-user in a production environment. Source code for the demo is provided within the SDK installer package.

Home Screen

Home Screen

Settings Screen

Home Screen

Capture Screen

Home Screen

Result Screen

Home Screen

Demo Code

This section provides details regarding the Face Capture API and how it is used to implement an application.

Create a Face Capture Object

Create a Face Capture Object
   mFaceCapture = new FaceCaptureJNI();

Create a Workflow Object

Create a Workflow Object
   mWorkFlow = mFaceCapture.workflowCreate(workflowName);

Adjust Workflow Settings

Adjust Workflow Settings
   mWorkFlow.setPropertyString(WorkflowProperty.USERNAME, mUsername);
   mWorkFlow.setPropertyDouble(WorkflowProperty.CAPTURE_TIMEOUT, mCaptureTimeout);
   mWorkFlow.setPropertyString(WorkflowProperty.CAPTURE_PROFILE, mCaptureProfile);

Select a Camera

Select a camera
   mCameraList = mFaceCapture.getCameraList(mCameraPosition);
   mCurrentCamera = mCameraList[0];
   mCurrentCamera.setOrientation(mCameraOrientation);

Begin a Capture Session

Begin a Capture Session
   mFaceCapture.startCaptureSession(mWorkFlow, mCurrentCamera);

Stop a Capture Session

Stop a Capture Session
   mFaceCapture.stopCaptureSession();

Get the capture region

Get capture region
   mCurrentCaptureRegion = mFaceCapture.captureSessionGetCaptureRegion();

Get the current Capture Session State

Capture Session State
   mCurrentCaptureState = mFaceCapture.getCaptureSessionState();

Get the Capture State’s Image

Capture Session Images
   mCurrentCaptureSessionFrame = mCurrentCaptureState.getFrame();

Get the Capture State’s Feedback

Capture Session Feedback
   mCurrentCaptureSessionFrame = mCurrentCaptureState.getFeedback();

Get the Capture State’s Status

Capture Session Status Changes
   mCurrentCaptureSessionFrame = mCurrentCaptureState.getStatus();

Get the Server Package

Get the Server Package
   mCurrentCaptureServerPackage = mFaceCapture.getServerPackage(mWorkFlow, mPackageType);

Get the Encrypted Server Package

Get the Encrypted Server Package
   mCurrentCaptureServerPackage = mFaceCapture.getEncryptedServerPackage(mEncryptionType, mPublicKey, mWorkFlow, mPackageType);

Enable Autocapture

Enable Autocapture
   mFaceCapture.captureSessionEnableAutocapture(true);