SDKJava (Android) SDK

Core objects & lifecycle

Android Java SDK: Core objects & lifecycle

Current version · 1.4.0

Core objects & lifecycle

Sdk owns the process SDK session, sdk.exo() returns the Exo domain, and exo.device(name) selects a configured device. ReadChannel<ExoTelemetry> and ReadChannel<ExoStatus> read data; StateChannel<ExoHaptics> also supports writes.

Lifecycle order

  1. Obtain USB permission, configure an explicit port in ExoConfig, and construct the SDK on a worker.
  2. Select the device, read its information, and call device.start() or exo.start().
  3. Choose background, calling-thread or manual operation; do not run duplicate loops.
  4. When finished, close the SDK on a worker thread. To stop a background runner while keeping the SDK open, call requestStop() and join() before restarting it.

stop() stops the current connection. With background operation, request stop and join() to finish disconnection/cleanup before checking state or reconnecting with start(). Reconnection does not replay haptics. device.close() closes its source/subscriptions; exo.close() closes the domain while leaving other domains and the SDK root usable. SDK close releases all resources and the accepted host transport.

Use one SDK instance per process with explicit ownership across Activity recreation. Keep blocking join/close off the main thread and out of callbacks. Exo has no independent connect(), disconnect(), calibration, firmware-maintenance or raw-protocol API.