LiGScanner

object LiGScanner

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

  1. Initialize the SDK: Call initialize with your product key

  2. Set up callbacks: Configure onLigtagFound and onStatusReported

  3. Start scanning: Call start to begin detection

  4. Handle results: Process LigTag objects from the callback

  5. 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

destroy
Link copied to clipboard
fun destroy()

Releaser the scanner SDK.

getUUID
Link copied to clipboard
fun getUUID(): String

Gets the unique device identifier for this Android device.

initialize
Link copied to clipboard
fun initialize(context: Context, productKey: String)

Initialize SDK.

start
Link copied to clipboard
fun start()

Start searching for LigTag device. Set onLigtagFound before start is called.

stop
Link copied to clipboard
fun stop()

Stop searching for LigTag device.

Properties

accessToken
Link copied to clipboard
var accessToken: String? = null

The authentication access token returned by the server.

initialized
Link copied to clipboard
var initialized: Boolean = false

Whether the scanner SDK is initialized.

onLigtagFound
Link copied to clipboard
var onLigtagFound: (LigTag?) -> Unit? = null

Callback invoked when a LigTag device is detected and processed.

onStatusReported
Link copied to clipboard
var onStatusReported: (SdkException.StatusCode) -> Unit? = null

Callback invoked when the SDK reports status changes or errors.

running
Link copied to clipboard
val running: Boolean

Whether the scanner is started and running.

VERSION
Link copied to clipboard
const val VERSION: String

The current version of the LiG Scanner SDK.