IStmGlobalConfig
The SDK global configuration interface (IStmGlobalConfig) is a non optional interface.
The interface is used for configuring underlying SDK components, such as API keys, and global configurations.
You can consume this class by subclassing it, which enables lazy value computation.
Interface
Kotlin:
open class IStmGlobalConfig {
sealed class StmLicensing
object Trial : StmLicensing()
class Online(
val key: String
) : StmLicensing()
class Offline(
val key: String
) : StmLicensing()
class FloatingServer(
val serverURL: String
) : StmLicensing()
/**
* set license; default is trial
*/
open fun licensing(): StmLicensing = Trial
}
Example
Kotlin:
class StmGlobalConfig() : IStmGlobalConfig() {
override fun licensing(): StmLicensing = Offline("license-key")
...
}
Java:
public class StmGlobalConfig extends IStmGlobalConfig {
public StmGlobalConfig() {
super();
}
@Override
public StmLicensing licensing() {
return new Offline("license-key");
}
...
}
Usage
The globalConfig needs to be configured via the StmDetection object.
Set the globalConfig at the StmDetection object (StmDetection)
Kotlin:
val stmDetection = StmDetection(
activity = this,
globalConfig = stmGlobalConfig,
detectionConfig = stmDetectionConfig,
flowDelegate = this)
Java:
StmDetection stmDetection = new StmDetection(
this,
stmGlobalConfig,
stmDetectionConfig,
this)
Additive
The IStmFlowDelegate parameter in the StmDetection constructor receives messages about detection progress and results.
The SDK detection configuration interface (IStmDetectionConfig) is used for configuring underlying SDK components, which are related to the detection.