LiG Scanner SDK for Android

Overview

The LiG Scanner SDK for Android enables android app to find LigTag device as entrance to AR world. Checkout Essentials For LiG Scanner SDK if you missed.

Limitation

  • SDK Level: Minimum SDK level 24.
  • ABI: Supports arm64-v8a only.
  • Device configuration: We need to customize camera parameters, thus some devices will not be supported. Devices in AR Core support list are in top priority. You can checkout LigTag Support List here.

Get Started

Use git to clone this repo to empower LigTag device, you can build and scan it right away.

If you have any troubles, please checkout Essentials For LiG Scanner SDK for more information. Product Key is used to authenticate with package name (or application id).

Import Scanner SDK as maven package

Checkout Maven Central Repository page. Import Scanner SDK package with following code snippet in kotlin:

implementation("tw.com.lig:scanner:7.5.0")

Initialization

Before initialize() is called, register LiGScanner.onStatusReported lambda to handle non-compatible device, poor internet or camera resource. Checkout SdkException.StatusCode for more information. Once initialization is done, you will received DEVICE_IS_SUPPORTED and AUTHENTICATION_OK in LiGScanner.onStatusReported callback.

// Kotlin
class LiGApp : Application() {
    override fun onCreate() {
        super.onCreate()
        val productKey = "your_product_key_here"
        LiGScanner.onStatusReported = { status ->
            if (status == SdkException.StatusCode.NO_SUPPORT_DEVICE) {
                Log.e("LiGApp", "NOT SUPPORTED")
            }
        }
        LiGScanner.initialize(this, productKey)
    }
}

Start Scanning

  1. Start Scanner: Call the start() method to begin scanning. The SDK will use the back camera on the mobile device. (Camera ID is 0)
  2. Handle Results: Implement the callback interface to receive scanning results and additional status updates.
  3. Stop Scanner: Call the stop() method to stop scanning and release the camera resources.
// Kotlin

// Status will be reported in running phase (after start() is called)
LiGScanner.onStatusReported = { status ->
    // Listen to status update
}

// Device info list (List<LightID>) will be returned
LiGScanner.onLightIDsFound = { ids ->
    if (ids.isNotEmpty()) {
        val lightId = ids[0]
        ...
    }
}

// Start to scan, running phase
LiGScanner.start()

API Reference

You can browse API documentation here.

Contact Us

For more information or to request a demo, please contact our sales team at rd@lig.com.tw.