Developer Guide

How to integrate the xg.glass SDK in your app.

Prerequisites

Minimum environment:

  • JDK 17
  • Android SDK + platform tools (you need adb on your PATH)
  • An Android phone (USB debugging enabled)
  • Android emulator (if you want to use the simulation mode)

Device-specific notes:

  • Frame (current implementation): requires Flutter on the developer machine because the SDK embeds a Flutter module at build time.

Installation

Currently, the SDK is consumed from source:

git clone <this-repo>
cd <this-repo>
pip install -e .

If a usage menu is printed by xg-glass --help, it means that xg-glass SDK is installed successfully.

Workflows (CLI)

Start with quick mode, then graduate to project mode when you want a stable workspace.

Quick mode: run a single Kotlin file

Let the CLI generate a temporary project and run it:

./xg-glass run /path/to/MyEntry.kt

Your entry file must follow a small format contract (documented in the CLI Reference).

Project mode: xg-glass init

Generate a minimal Android project and iterate:

./xg-glass init ./myapp
cd ./myapp
../xg-glass build
../xg-glass install
../xg-glass run

Your app logic lives in:

  • ug_app_logic/src/main/java/.../ExampleAppEntry.kt

App logic

When you write your app logic (ExampleAppEntry.kt), you mainly use:

  • Capture a photo: capturePhoto(...)
  • Display text: display(text, ...)
  • Record audio: startMicrophone(...)

The host app (generated/provided by the SDK template) owns the connection lifecycle and UI.

See the detailed API surface and code examples in API Reference.