Getting Started
Usage of the SDK revolves around the StmDetection class. It implements a customizable Detection process.
Setup
The SDK detection runs in a background process.
It is sufficient to link SDK into your Android project (Installation). The Android SDK will not become active until an instance of the StmDetection is created.
Your application maintains the SDK's global configuration using the IStmGlobalConfig interface.
In a typical use case, it is sufficient to set your license key, which is provided to you by T3k.
The IStmGlobalConfig object can be set on the StmDetection object.
There are two other important interfaces, which can be set on the StmDetection object:
- IStmScanConfig for configuring underlying SDK components, which are related to the detection.
- IStmFlowDelegate for additional delegate events.
Use of the StmDetection class
To use the SDKs Scan Activity, it is required to create an Activity, which inherits from the BcmScanActivity. This is mandatory for setting the IBcmGlobalConfig object.
Kotlin:
class YourStmDetectionActivity : Activity(), IStmFlowDelegate {
class StmGlobalConfigOverride : IStmGlobalConfig() {
open fun licensing(): StmLicensing = Offline("license-key")
}
class StmDetectionConfigOverride : IStmScanConfig() {
open fun hitBasedOnly(): Boolean = false
...
}
var stmDetection: StmDetection? = null
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_main)
stmDetection = StmDetection(
activity = this,
globalConfig = StmGlobalConfigOverride(),
detectionConfig = StmDetectionConfigOverride(),
flowDelegate = this)
}
...
}
Java:
public class YourStmDetectionActivity extends Activity implements IStmFlowDelegate {
class StmGlobalConfigOverride extends IStmGlobalConfig {
@Nullable
@Override
public StmLicensing licensing() {
return ...;
}
}
StmDetection stmDetection = null;
class StmDetectionConfigOverride extends IStmScanConfig {
@Nullable
@Override
public ScanTerminationOptions scanTerminationOption() {
return ...;
}
}
@Override
void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_main)
stmDetection = new StmDetection(
this,
new StmGlobalConfigOverride(),
new StmDetectionConfigOverride(),
this)
}
...
}
Detection
A detection process requires a flow delegate (IStmFlowDelegate) to return detection result data to your application.
A detection returns an instance of StmRecognition to your application.
Please proceed to the next topic (Scan Setup) for detection customization and IStmFlowDelegate setup.
See Also
- IStmDetectionConfig for configuring underlying SDK components, which are related to the detection process.
- IStmFlowDelegate for additional delegate events.