Android – PDF417 Camera Scanner & Local ID Parser

Scanner & Parser SDK – Download

This SDK contains both the scanner and parsing components. It allows a camera-enabled Android smartphone to scan a driver’s license and parse the data locally. It consists of the following files:

  • dlparserlib.jar
  • android-support-v4.jar
  • several libidscan_parser.so
  • PDF417Scanner.aar

Implementation Instructions Using Android Studio

1. With your project open in Android Studio, go to File -> New -> New Module. Select “Import JAR/AAR” and select file path to PDF417Scanner.aar.

New Module Page

File Path Page

2. Copy dlparser.jar and android-support-v4.jar to your project’s libs folder.

3. Add dependencies in your app’s build.gradle for “:PDF417Scanner”, dlparserlib.jar, android-support-v4.jar and com.android.support:appcompat-v7 as well as any additional dependencies you may need:

dependencies {
    compile 'com.android.support:appcompat-v7:23.0.1'
    compile project(':PDF417Scanner')
    compile 'com.android.support:design:23.0.1'
    compile files('libs/idscan_android_lib.jar')
    compile 'com.android.support:support-v4:21.0.3'
    compile files('libs/dlparserlib.jar')
    ...
    ...
}

Add the following lines to your Android Manifest:

permission.CAMERA”/>
hardware.camera.autofocus”/>
hardware.camera”/>

4. Clean project.

5. Create a “jniLibs” folder under src/main, and copy all folders containing a libidscan_parser.so file to jniLibs.

Performing A Scan And Parsing Results

To start your scan, start PDF417ScanActivity as follows:

Start Scan and License Key

To obtain a license key for either the scanner or parser, please email your application’s package name to support@781.fdb.myftpupload.com. Copy the received key to i.putExtra(PDF417ScanActivity.EXTRA_LICENSE_KEY, _key); in the above screenshot. onActivityResult will be called once PDF417ScanActivity has completed the scan. The scanning results can be accessed within onActivityResult:

onActivityResult

To set up the parser, initialize DLParser object and use setup() with a valid key. Results can be obtained by using DLParser’s parse() method and they are stored in a DLResult object, where individual fields can be accessed.

Parser Setup