IBcmGlobalConfig
The SDK global configuration interface (IBcmGlobalConfig) is a non optional interface.
The interface is used for configuring underlying Biocapture SDK components, such as API keys, and global branding.
You can consume this class by subclassing it, which enables lazy value computation.
Interface
Kotlin:
open class IBcmGlobalConfig {
/**
* SDK licensing and activation
*/
sealed class BcmLicensing
object Trial : BcmLicensing()
class Online(
val key: String
) : BcmLicensing()
class FloatingServer(
val serverURL: String
) : BcmLicensing()
class Offline(
val key: String
) : BcmLicensing()
// set license; default is trial
open fun licensing(): BcmLicensing = Trial
/**
* Branding configuration interface; can be overwritten
*/
open fun branding(): IBcmBranding = IBcmBranding()
}
Example
Kotlin:
class BcmGlobalConfig() : IBcmGlobalConfig() {
override fun licensing(): BcmLicensing = Trial
// override fun licensing(): BcmLicensing = Offline("...token")
override fun branding(): IBcmBranding = BcmBranding()
...
}
Java:
public class BcmGlobalConfig extends IBcmGlobalConfig {
public BcmGlobalConfig() {
super();
}
@Override
public BcmLicensing licensing() {
return BcmLicensing.Trial();
}
@Nullable
@Override
public IBcmBranding branding() {
return new BcmBranding();
}
...
}
Usage
You can either inherit from the SDK Scan Activity (BcmScanActivity) and set the globalConfig or set the globalConfig at the Fragment level (BcmScanFragment).
Set the globalConfig at the Scan Activity level (BcmScanActivity)
Kotlin:
class YourBcmScanActivity : BcmScanActivity() {
/**
* Set config take place here
*/
init {
globalConfig = BcmGlobalConfig()
}
}
Java:
public class YourBcmScanActivity extends BcmScanActivity {
// Instance initialization block
/**
* Set config take place here
*/
{
setGlobalConfig(new BcmGlobalConfig());
}
}
Set the globalConfig at the Scan Fragment level (BcmScanFragment)
Kotlin:
val scanFragment: ScanFragment = BcmScanFragment(
BcmGlobalConfig(),
BcmScanConfig(),
this);
Java:
BcmScanFragment scanFragment = new BcmScanFragment(
new BcmGlobalConfig(),
new BcmScanConfig(),
this);