Android

Document Capture (Android)

Estimated reading: 4 minutes 266 views

Welcome to AwareID Document Capture for Android

Importing the Face Capture SDK to a Project

To include the Face Capture SDK in your application requires three steps:

  1. Update the gradle dependencies and include the AARs in the application lib directory.

    • Add or update the filetree line to include searching for AARs. i.e. api fileTree(dir: ‘libs’, include: [’*.aar’])
    • The dependency section of your application’s gradle may look like the following:

Listing 1 Gradle Dependency

   dependencies {
       api fileTree(dir: 'libs', include: ['*.jar', '*.aar'])

       androidTestImplementation('com.android.support.test.espresso:espresso-core:2.2.2', {
           exclude group: 'com.android.support', module: 'support-annotations'
       })
       api 'com.squareup.okhttp3:okhttp:3.10.0'
       api 'com.android.support:appcompat-v7:26.1.0'
       api 'com.android.support:design:26.1.0'
       api 'com.android.support.constraint:constraint-layout:1.1.3'
       testImplementation 'junit:junit:4.12'
   }

  1. Copy the Aware-DocAuthAwareId.aar from the lib directory to the libs directory of your application.
  2. Import Face Capture into your application code to start using the DocAuthAwareId classes.

Listing 2 Import Example

   import com.aware.docauthawareid.api.DocAuthAwareIdApi;

Importing the Document Capture SDK to a Project

To include the Document Capture SDK in your application requires three steps:

  1. Update the “root” gradle dependencies.

    • The dependency section of your root’s gradle may look like the following:

Listing 3 Gradle Dependency

   ...
   subprojects {
       apply plugin: 'maven-publish'

       repositories {
           mavenCentral()

           maven {
               url "http://maven.regulaforensics.com/RegulaDocumentReader"
               allowInsecureProtocol = true
           }
       }
   }

  1. Update the “app” gradle dependencies.

    • The dependency section of your application’s gradle may look like the following:

Listing 4 Gradle Dependency

   dependencies {
       ...
       implementation 'com.regula.btdevice:api:1.0+@aar'
       implementation 'com.regula.documentreader.core:fullrfid:6.8.+@aar' // use fullauthrfid core for 7310
       implementation('com.regula.documentreader:api:6.8.+@aar') {
           transitive = true
       }
   }

  1. Update the settings.gradle file.

Listing 5 Gradle Dependency

   import org.gradle.api.initialization.resolve.RepositoriesMode

  1. Make sure the license file is located here “/app/src/main/res/raw/regula.license”

Running the AwareID Document Capture Demo

The AwareID Document Capture installer comes with two demos DocAuthAwareIdDemo and DocAuthAwareIdDemoQR. Each demo will capture a face then document in order to perform a facial match for validation.

DocAuthAwareIdDemo

Launching the DocAuthAwareIdDemo for the first time will bring you to the settings page. You will need to enter the following information obtained from the AwareID admin server before you will be able to enroll:

  • Host URL
  • Customer Name
  • API Key
  • Client Secret

Please see the server documentation for additional details on these fields.

Finish filling out the User Name, Email, and Phone Number fields to complete the settings page. Press the Back button at the top of the settings page to reach the home screen. Accept the prompt requesting permission to access the device’s camera(s). Hit the Enroll button and follow the directions on screen to perform a facial capture. Once a face has been captured, the demo will automatically switch to landscape orientation to perform a document capture. After successfully completing both face and document captures, the demo will return you to the home screen.

Press the Verify button to initiate a facial image capture. After processing, the demo will pop up either “Authentication Success” or “Authentication Failed” based on the verification results.

DocAuthAwareIdDemoQR

Launching the DocAuthAwareIdDemoQR for the first time will immediately prompt you for permission to access the device’s camera(s). After accepting permissions, you will be brought to the home screen. Press the Scan QR Code button to begin enrollment. Scan the QR code generated from the Web App to enroll. Please see the AwareID server documentation for additional details on generating the QR code.

After scanning the QR code successfully, the demo will go to the face capture screen. Follow the directions on screen to capture a facial image. Once a face has been captured, the demo will switch to landscape orientation to perform a document capture. Completing the document capture will end the enrollment process and bring you back to the home screen.

To perform verification, either scan the QR code again or trigger a push notification from the web application. This will initiate a facial image capture. After processing, the demo will pop up either “Authentication Success” or “Authentication Failed” based on the verification results.

CONTENTS