.. _ChapterAndroidIntegration: ******************* 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: .. image:: screen_home.png :align: center :alt: Home Screen :width: 350px :height: 600px :scale: 50% Settings Screen ^^^^^^^^^^^^^^^ .. image:: screen_settings.png :align: center :alt: Home Screen :width: 350px :height: 600px :scale: 50% Capture Screen ^^^^^^^^^^^^^^ .. image:: screen_capture.png :align: center :alt: Home Screen :width: 350px :height: 600px :scale: 50% Result Screen ^^^^^^^^^^^^^ .. image:: screen_result.png :align: center :alt: Home Screen :width: 350px :height: 600px :scale: 50% 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 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ .. code-block:: JAVA :caption: *Create a Face Capture Object* :name: createAFaceCaptureObject mFaceCapture = new FaceCaptureJNI(); Create a Workflow Object ^^^^^^^^^^^^^^^^^^^^^^^^ .. code-block:: JAVA :caption: *Create a Workflow Object* :name: createAWorkflowObject mWorkFlow = mFaceCapture.workflowCreate(workflowName); Adjust Workflow Settings ^^^^^^^^^^^^^^^^^^^^^^^^ .. code-block:: JAVA :caption: *Adjust Workflow Settings* :name: adjustWorkflowSettings mWorkFlow.setPropertyString(WorkflowProperty.USERNAME, mUsername); mWorkFlow.setPropertyDouble(WorkflowProperty.CAPTURE_TIMEOUT, mCaptureTimeout); mWorkFlow.setPropertyString(WorkflowProperty.CAPTURE_PROFILE, mCaptureProfile); Select a Camera ^^^^^^^^^^^^^^^ .. code-block:: JAVA :caption: *Select a camera* :name: selectACamera mCameraList = mFaceCapture.getCameraList(mCameraPosition); mCurrentCamera = mCameraList[0]; mCurrentCamera.setOrientation(mCameraOrientation); Begin a Capture Session ^^^^^^^^^^^^^^^^^^^^^^^ .. code-block:: JAVA :caption: *Begin a Capture Session* :name: beginACaptureSession mFaceCapture.startCaptureSession(mWorkFlow, mCurrentCamera); Stop a Capture Session ^^^^^^^^^^^^^^^^^^^^^^^ .. code-block:: JAVA :caption: *Stop a Capture Session* :name: stopACaptureSession mFaceCapture.stopCaptureSession(); Get the capture region ^^^^^^^^^^^^^^^^^^^^^^ .. code-block:: JAVA :caption: *Get capture region* :name: getTheCaptureRegion mCurrentCaptureRegion = mFaceCapture.captureSessionGetCaptureRegion(); Get the current Capture Session State ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ .. code-block:: JAVA :caption: *Capture Session State* :name: captureSessionState mCurrentCaptureState = mFaceCapture.getCaptureSessionState(); Get the Capture State's Image ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ .. code-block:: JAVA :caption: *Capture Session Images* :name: captureSessionImages mCurrentCaptureSessionFrame = mCurrentCaptureState.getFrame(); Get the Capture State's Feedback ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ .. code-block:: JAVA :caption: *Capture Session Feedback* :name: captureSessionFeedback mCurrentCaptureSessionFrame = mCurrentCaptureState.getFeedback(); Get the Capture State's Status ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ .. code-block:: JAVA :caption: *Capture Session Status Changes* :name: captureSessionStatusChanges mCurrentCaptureSessionFrame = mCurrentCaptureState.getStatus(); Get the Server Package ^^^^^^^^^^^^^^^^^^^^^^ .. code-block:: JAVA :caption: *Get the Server Package* :name: getTheServerPackage mCurrentCaptureServerPackage = mFaceCapture.getServerPackage(mWorkFlow, mPackageType); Get the Encrypted Server Package ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ .. code-block:: JAVA :caption: *Get the Encrypted Server Package* :name: getTheEncryptedServerPackage mCurrentCaptureServerPackage = mFaceCapture.getEncryptedServerPackage(mEncryptionType, mPublicKey, mWorkFlow, mPackageType); Enable Autocapture ^^^^^^^^^^^^^^^^^^ .. code-block:: JAVA :caption: *Enable Autocapture* :name: enableAutocapture mFaceCapture.captureSessionEnableAutocapture(true);