OVD KINEGRAM ScanSDK for Android

OVD KINEGRAM ScanSDK is a powerful SDK that enables developers to integrate scanning functionalities into their Android applications.

The SDK supports the scanning of various objects, such as

Supported Number Plates

ScanSDK has been trained to recognize license plates from Switzerland, UK, and the EU in accordance with EU Council Regulation (EC) No 2411/98.

Supported Barcode Formats

Linear product Linear industrial Matrix
UPC-A Code 39 QR Code
UPC-E Code 93 Micro QR Code
EAN-8 Code 128 rMQR Code
EAN-13 Codabar Aztec
DataBar DataBar Expanded DataMatrix
DX Film Edge PDF417
ITF MaxiCode (partial)

Preconditions

Usage

Importing

In your top level build.gradle:

allprojects {
    repositories {
        google()
        mavenCentral()
        maven {
            url 'https://git.kurzdigital.com/api/v4/projects/1700/packages/maven'
            credentials {
                username 'gitlab+deploy-token-57'
                password 'gldt-_SwWL2B5y3m1NRfpzvox'
            }
        }
    }
}

In your app/build.gradle:

dependencies {
    // …
    implementation 'com.kinegram.android:scansdk:x.x.x'
}

Replace x.x.x with the version number of the latest release.

Quick Start

Then just use startActivityForResult() to start the ScanActivity like this:

package com.kinegram.android.scansdk.demo

import android.app.Activity
import android.app.AlertDialog
import android.content.Intent
import android.os.Bundle
import android.view.View
import com.kinegram.android.scansdk.Scanner
import com.kinegram.android.scansdk.activity.ScanActivity
import com.kinegram.android.scansdk.activity.ScanActivity.Companion.getScanResults

class MainActivity : Activity() {
    override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) {
        if (requestCode != SCAN_RESULT || resultCode != RESULT_OK) {
            return
        }
        val results = data?.getScanResults() ?: return
        val message = results.joinToString("\n") { result ->
            "${result.type}:\n${
                when (result.type) {
                    Scanner.ScanType.Barcode -> "${result.text}\n${result.format}"
                    Scanner.ScanType.MRZ -> result.mrz?.toString()
                    Scanner.ScanType.IDL -> result.idl?.toString()
                    Scanner.ScanType.VDS -> result.vds?.toString()
                    Scanner.ScanType.VDSNC -> result.vdsNc?.toString()
                    Scanner.ScanType.NumberPlate -> result.numberPlate?.toString()
                    else -> result.text
                }
            }"
        }
        AlertDialog.Builder(this)
            .setMessage(message)
            .create()
            .show()
    }

    override fun onCreate(state: Bundle?) {
        super.onCreate(state)
        setContentView(R.layout.activity_main)

        findViewById<View>(R.id.scan).apply {
            setOnClickListener {
                startActivityForResult(
                    Intent(this@MainActivity, ScanActivity::class.java),
                    SCAN_RESULT
                )
            }
        }
    }

    companion object {
        private const val SCAN_RESULT = 1
    }
}

Or, if you're using AndroidX, this would be the new, recommended way:

import com.kinegram.android.scansdk.Scanner
import com.kinegram.android.scansdk.activity.ScanActivity
import com.kinegram.android.scansdk.activity.ScanActivity.Companion.getScanResults

class MainActivity : AppCompatActivity() {
    private val resultLauncher = registerForActivityResult(
        ActivityResultContracts.StartActivityForResult()
    ) { result ->
        if (result.resultCode == RESULT_OK) {
            val results = result.data?.getScanResults() ?: return@registerForActivityResult
            …
        }
    }

    fun openScanner() {
        resultLauncher.launch(Intent(this, ScanActivity::class.java))
    }
}

And don't forget to declare ScanActivity in your AndroidManifest.xml:

<?xml version="1.0" encoding="utf-8"?>
<manifest …>
    <application …>
        …
        <activity
            android:name="com.kinegram.android.scansdk.activity.ScanActivity"
            android:theme="@style/ScanSDKTheme"
            android:exported="true"/>
    </application>
</manifest>

ScanResult

A list of ScanResult objects is returned in onActivityResult(). Each ScanResult object contains the recognized data from the scan, along with its type, which is defined by the ScanType enum.

Custom VDS Profiles

Use Scanner.setVDSProfiles() to specify custom VDS profiles before scanning:

Scanner.setVDSProfiles(
    "["
        "{\"id\":4128,\"features\":["
            "{\"tag\":2,\"name\":\"foo\",\"type\":\"UTF8STR\"}"
        "]}"
    "]"
)

The integer key (4128 in this example, which is 0x1020 hexadecimal, JSON does not support hexadecimal numbers, unfortunately) must be the "Document Feature Definition Reference" byte (0x10 in bit 9 to 16) and the "Document Type Category" byte (0x20 in bit 1 to 8). These bytes identify a VDS profile.

For each document feature you need to specify a tag (2), a name (foo) and a type (UTF8STR). Possible types are:

Verify a VDS

To verify a VDS, you need the certificate with which the VDS was signed.

Use Scanner.setCertificates() to specify a list of certificate files before scanning:

Scanner.setCertificates(listOf("path/to/certificate.cer"))

Verify a VDS-NC

To verify a VDS-NC the CSCA (Country Signing Certificate Authority) certificate of the issuing country is required. This certificate can be obtained from the ICAO Master List or the BSI Master List.

Use Scanner.setCMS() to specify a list of master list files before scanning:

Scanner.setCMS(listOf("path/to/masterlist.ml"))

Changelog

Changelog

License

LICENSE

Support

If you encounter any issues or have any questions, we encourage you to open an issue in the GitHub issue tracker.

Our team will be happy to assist you and address any problems you may have. Alternatively, you can contact us at .