BcmCalibrationActivity

The Calibration Activity (BcmCalibrationActivity) is the Biocapture SDK's central Activity for the device calibration. It internally manages the BcmCalibrationFragment.

You can consume this class by subclassing(BcmCalibrationActivity). The Calibration Activity is configured using an instance of the IBcmCameraConfig. The configuration is automatically passed to the BcmCalibrationFragment, which is the main player in the calibration process.

Progress is reported to an object implementing the IBcmCalibrationDelegate interface.

Please refer to the usage examples for a high-level overview of the Scan Activity.

Caveats

Configure the SDK while no Calibration Fragment (BcmCalibrationFragment) is active to ensure that your configuration is applied to all calibration sessions.

Interface

Kotlin:

open class BcmCalibrationActivity() : AppCompatActivity() {

    /**
     * Camera configuration interface; can be overwritten
     */
    var cameraConfig: IBcmCameraConfig = IBcmCameraConfig(),

    /**
     * A delegate object for calibration events
     */
    var calibrationDelegate: IBcmCalibrationDelegate? = null

    /**
     *  Calibration Fragment instance
     *  All the calibration magic takes place in this Fragment
     */
    var calibrationFragment: BcmCalibrationFragment? = null

}

Java:

public class BcmCalibrationActivity extends AppCompatActivity {

    /**
     * Camera configuration interface; can be overwritten
     */
    public IBcmCameraConfig cameraConfig = new IBcmCameraConfig();

    /**
     * A delegate object for calibration events
     */
    public IBcmCalibrationDelegate calibrationDelegate = null;

    /**
     *  Calibration Fragment instance
     *  All the calibration magic takes place in this Fragment
     */
    public BcmCalibrationFragment scanFragment = null;

}

Usage

Configuring the Calibration Activity

To use the SDKs Calibration Activity, it is required to create an own Activity, which inherits from the BcmCalibrationActivity. This is mandatory to be able to set the IBcmCameraConfig and the object implementing the IBcmCalibrationDelegate interface.

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

<activity
    android:name="your.package.name.BcmCalibrationActivityOverride"
    android:screenOrientation="landscape" />

Your Activity maintains the Biocapture SDK's calibration camera configuration using the IBcmCameraConfig interface. The IBcmCameraConfig object can be set on the Activity level, using the cameraConfig field.

Assign a calibrationDelegate object to receive information about calibration progress and the final result (IBcmCalibrationDelegate).

Kotlin:

class BcmCalibrationActivityOverride : BcmCalibrationActivity(), IBcmCalibrationDelegate {

    class BcmCameraConfigOverride : IBcmCameraConfig() {
        open fun frameResolution(): CameraFrameResolution? = ...
    }

    /**
     * Set config take place here
     */
    init {
        cameraConfig = BcmCameraConfigOverride()
        calibrationDelegate = this
    }
}

Java:

public class BcmCalibrationActivityOverride extends BcmCalibrationActivity implements IBcmCalibrationDelegate {

    class BcmCameraConfigOverride extends IBcmCameraConfig {
        @Nullable
        @Override
        public CameraFrameResolution frameResolution() {
            return ...;
        }
    }

    // Instance initialization block
    /**
     * Set config take place here
     */
    {
        setCameraConfig(new BcmCameraConfigOverride());
        setCalibrationDelegate(this);
    }

}

The settings are applied for all future calibration sessions during your app's Calibration Activity lifetime.

Creating a Calibration Activity Instance

Once configured, you are ready to scan fingerprints by presenting BcmCalibrationActivity using an Intent:

Kotlin:

val bcmCalibrationIntent = Intent(
    context,
    BcmCalibrationActivityOverride::class.java)

startActivity(bcmCalibrationIntent)

Java:

Intent bcmCalibrationIntent = new Intent(
    context,
    BcmCalibrationActivityOverride.class);

startActivity(bcmCalibrationIntent);

Calibration Session Management

The Calibration Activity by default automatically manages scan sessions via the Calibration Fragment, meaning it will start a calibration session when presented, stop it when hidden or dismissed, and restart a new calibration session after a calibration completes (unless dismissed by the Activity).

See Also

results matching ""

    No results matching ""