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 BcmCameraConfig. 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() {
/**
* An object enables basic configuration of SDK behavior.
*/
var globalConfig: BcmGlobalConfig = BcmGlobalConfig()
/**
* Camera configuration interface; can be overwritten
*/
var cameraConfig: BcmCameraConfig = BcmCameraConfig()
var useIdCardCalibration: Boolean = true
/**
* A delegate object for calibration events
*/
var calibrationDelegate: IBcmCalibrationDelegate? = null
}
Java:
public class BcmCalibrationActivity extends AppCompatActivity {
/**
* An object enables basic configuration of SDK behavior.
*/
public BcmGlobalConfig globalConfig = new BcmGlobalConfig();
/**
* Camera configuration interface; can be overwritten
*/
public BcmCameraConfig cameraConfig = new BcmCameraConfig();
public Boolean useIdCardCalibration = True;
/**
* A delegate object for calibration events
*/
public IBcmCalibrationDelegate calibrationDelegate = 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 BcmCameraConfig 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 BcmCameraConfig interface. The BcmCameraConfig 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 : BcmCameraConfig() {
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 BcmCameraConfig {
@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).