IStmFlowDelegate
The detection flow delegate receives messages about detection progress and results by StmDetection. It provides your application with the detection result or error, including environment-related errors.
Interface
Kotlin:
/**
* Detection flow delegate - callback from the SDK
* When running code - which have to run on the main thread - you've to dispatch the code block
* to the main thread
*/
interface IStmFlowDelegate {
public enum class StmDetectionError {
/**
* There is a problem with the given license key.
* Please also check the network connection - a network connection is mandatory.
*/
LicenseProblem,
/**
* There is a problem with the current configuration.
*/
WrongConfiguration,
/**
* An internal error occurred, please inspect the logs for details.
*/
Unknown,
}
/**
* Something went terribly wrong (as indicated by errorCode) and things are now broken.
* Notify your user.
*/
fun stmUnrecoverableError(
errorCodeBcm: StmDetectionError,
errorMessage: String
)
fun stmInitialized()
/**
* Detection has completed.
*/
fun stmDetectionResult(
detections: List<StmRecognition>,
hit: Boolean
)
}
Usage
Implement at least IStmFlowDelegate.unrecoverableError() and IStmFlowDelegate.stmDetectionResult() for receiving the detection results.