Getting Started

Usage of the Biocapture SDK revolves around the BcmScanActivity and the BcmScanFragment class. It implements a customizable Activity and Fragment, which is based on AndroidX. Minor setup is needed prior to presenting a Scan Activity or the Scan Fragment.

Setup

The Biocapture SDK scan view runs in an Android Fragment, but there is also a predefined Scan Activity, which initializes the Fragment. Either start the scan by using the predefined Scan Activity or open the Scan Fragment in your Activity.

It is sufficient to link Biocapture SDK into your Android project (Installation). The Biocapture Android SDK will not become active until the scan Activity or Fragment is initiated.

Your application maintains the Biocapture SDK's global configuration using the BcmGlobalConfig interface. In a typical use case, it is sufficient to set your license key, which is provided to you by Biocapture. The BcmGlobalConfig object can be set on the Fragment or Activity level, depends on your scanning setup.

There are two other important interfaces, which can be set on the scan Fragment or Activity level:

  • BcmScanConfig for configuring underlying Biocapture SDK components, which are related to the scan.
  • IBcmFlowDelegate for additional delegate events.

Use of the Scan Activity

To use the SDKs Scan Activity, it is required to create an Activity, which inherits from the BcmScanActivity. This is mandatory for setting the BcmGlobalConfig object.

Kotlin:

class YourBcmScanActivity : BcmScanActivity() {

    class BcmGlobalConfig : BcmGlobalConfig() {
        open fun licenseKey(): String? = ...
    }

    /**
     * Set config takes place here
     */
    init {
        globalConfig = BcmGlobalConfig()
    }
}

Java:

public class BcmScanActivityJavaOverride extends BcmScanActivity {

    class BcmGlobalConfig extends BcmGlobalConfig {
        @Nullable
        @Override
        public String licenseKey() {
            return ...;
        }
    }

    // Instance initialization block

    /**
     * Set config takes place here
     */ {
        setGlobalConfig(new BcmGlobalConfig());
    }

}

It also requires the declaration of your defined Scan Activity, in the AndroidManifest.xml.


<activity android:name="your.package.name.YourBcmScanActivity" android:screenOrientation="landscape"
        android:theme="@style/BcmTheme.NoActionBarTheme" />

For the online license check it's mandatory to add the INTERNET permission in the AndroidManiffest.xml!


<uses-permission android:name="android.permission.INTERNET" />

Once configured, you are ready to capture fingerprints by presenting BcmScanActivity using an Intent:

Kotlin:

val bcmScanIntent = Intent(
    context,
    YourBcmScanActivity::class.java)

startActivity(bcmScanIntent)

Java:

Intent bcmScanIntent=new Intent(
    context,
    YourBcmScanActivity.class);

    startActivity(bcmScanIntent);

It internally manages the BcmScanFragment.

Note: When running the app, you will maybe get an Manifest merger failed error. We offer a complete GUI in our SDK, therefore you have to overwrite the android:theme in your Manifest:

<application
    ...
    tools:replace="android:theme,android:allowBackup">

Use of the Scan Fragment

It is also possible to start the BcmScanFragment in another Activity. In this case it is also mandatory to set the BcmGlobalConfig object on the Fragment level. This will be done with constructor invocation.

Starting the Biocapture SDK Fragment using the supportFragmentManager of the Activity:

Kotlin:


val scanFragment: BcmScanFragment = BcmScanFragment(
    globalConfig = BcmGlobalConfig())

supportFragmentManager.beginTransaction().replace(
    R.id.content_frame,
    scanFragment)
    .addToBackStack("BcmScan")
    .commitAllowingStateLoss()

Java:

BcmScanFragment scanFragment=new BcmScanFragment(
    new BcmGlobalConfig(),
    new BcmScanConfig(),
    this);

    getSupportFragmentManager().beginTransaction().replace(
    R.id.content_frame,
    scanFragment)
    .addToBackStack("BcmScan")
    .commitAllowingStateLoss()

The SDK reuquests the camera permission in the Fragment automatically. Be careful when open the Scan Fragment in the onResume() method of the Activity. The permission request causes to execute the onResume() method twice. This is the default behaviour of the Android system. It is also possible to implement the Camera permission reuqust on your own.

Scanning

Scanning requires a flow delegate (IBcmFlowDelegate) to return scan data to your application.

A scan returns an instance of BcmFingerImage and BcmFingerImageLiveScore to your application.

Please proceed to the next topic (Scan Setup) for scan customization and IBcmFlowDelegate setup.

See Also

  • BcmScanConfig for configuring underlying Biocapture SDK components, which are related to the scan.
  • IBcmFlowDelegate for additional delegate events.

results matching ""

    No results matching ""