Li GScanner
LiGScanner is the main entry point for the LiG Scanner SDK.
This singleton object provides the primary interface for integrating LigTag detection and 6DOF pose estimation capabilities into Android applications. The SDK enables real-time detection of LigTag devices through the camera and provides accurate 3D position and rotation data for AR applications.
Basic Usage
Initialize the SDK: Call initialize with your product key
Set up callbacks: Configure onLigtagFound and onStatusReported
Start scanning: Call start to begin detection
Handle results: Process LigTag objects from the callback
Stop scanning: Call stop when done
Example
// Set up callbacks
LiGScanner.onLigtagFound = { ligTag ->
ligTag?.let {
if (it.isReady) {
// Use 3D position and rotation for AR
val position = it.position
val rotation = it.rotation
}
}
}
LiGScanner.onStatusReported = { status ->
when (status) {
SdkException.StatusCode.AUTHENTICATION_OK -> // Ready to start
SdkException.StatusCode.NO_CAMERA -> // Handle camera issues
// Handle other status codes
}
}
// Initialize and start
LiGScanner.initialize(this, "your-product-key")
LiGScanner.start()
Threading
All callbacks are invoked on the main (UI) thread
Network operations (authentication) happen on background threads
Camera operations are handled on dedicated camera threads
See also
Functions
Initialize SDK.
Start searching for LigTag device. Set onLigtagFound before start is called.