SDKJava (Android) SDK

Migration

API replacements and workflow changes when upgrading from Glove SDK 1.9.0 to 2.0.0 (Helix magnetic-inertial glove support) or earlier versions.

Current version · 2.0.0

Migration

Upgrading from 1.9.0 to 2.0.0

Helix magnetic-inertial glove support and read interface changes

2.0.0 adds Helix magnetic-inertial glove support. Helix uses the existing Glove discovery, configuration, connection and startup entry points, so current integration code connects it without a new workflow. Read interfaces change as follows:

  • pose: read hand and wrist separately through the optional payload.hand / payload.wrist instead of payload-level fingertip and pose fields; rootPose is removed, so check null before access and correlate hand and wrist by their own timestamps.
  • imu: read payload.imus per sensor, select by id / location and check each sensor's valid / fresh; read the magnetometer as raw counts from the optional payload.magnetometer.
  • emf: device.emf() is new and returns raw I/Q signed integral matrices acquired in pairs with hand pose, selected on a worker thread; EMF time uses the millisecond accessors ref(), error() and bError() on GloveHelixEmfTime.

When upgrading from 1.8.1 or earlier, see the field replacement table under Upgrading from 1.8.1 to 1.9.0 on this page; see Reading raw data for channel fields and correlation.

Update the matched Glove 2.0.0 and Core 2.0.0 AARs or complete offline directory together, upgrading Java classes and JNI libraries as one batch. Rebuild with ./gradlew :app:assembleDebug and the app's release/R8 build while retaining the AAR consumer rules. Check the exact Exo Core dependency before upgrading a composite application.

Unified bone configuration, default replacement, and export

2.0.0 removes BoneConfig.createSession() and BoneConfig.importFile(), unifies creation under BoneConfig.create(), and adds BoneConfig.exportFile() for backups. Migrate call sites as follows:

1.9.0 behavior2.0.0 migration
BoneConfig.createSession(context, side, operatorId)Use BoneConfig.create(context, side, operatorId, CaptureInteractionMode.EXTERNAL).session()
Terminal preparationUse BoneConfig.create(context, side, operatorId).installed() with default AUTO_TERMINAL
session.install() rejects an existing profileNow replaces the same operator and hand profile by default. Pass BoneConfigOverwritePolicy.DENY to retain rejection
BoneConfig.importFile(context, Path/Uri, ...)Remove the call and restore through the app-owned file flow below
Back up a saved profileUse BoneConfig.exportFile(context, destination, side, operatorId), which returns Path and defaults to DENY

Run preparation on a worker thread before constructing the SDK. Terminal mode returns an installation result and closes its session on success or failure. Android App interfaces should explicitly select EXTERNAL, keep the returned session open, present its phone link or QR code, poll until COMPLETED, install and close. Cancel an abandoned measurement before closing. The terminal overwrite argument applies to terminal creation. External callers select the policy at session.install(). Both measured-save paths default to REPLACE_EXISTING. Export destination replacement requires explicit REPLACE_EXISTING.

Before restoring a historical file, stop and close the old SDK. Use valid UTF-8 single-hand “上位机配置 YAML”. The app obtains or selects the data root with public Sdk.initialize before constructing a new SDK. The following helper selects an app-private root and restores the default operator’s right hand. selectedYaml is a readable local file prepared by the app from its file picker or backup.

import android.content.Context;
import com.qnbot.sdk.Sdk;
import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.StandardCopyOption;

public final class BoneProfileRestore {
  private BoneProfileRestore() {}

  public static Path restoreDefaultRight(Context context, Path selectedYaml) throws IOException {
    Path dataRoot = context.getFilesDir().toPath().resolve("qnbot");
    Path root = Sdk.initialize(context, dataRoot);
    Path saved = root.resolve("glove/bone-configs/default/right.yaml");
    Files.createDirectories(saved.getParent());
    Files.copy(selectedYaml, saved, StandardCopyOption.REPLACE_EXISTING);
    return root;
  }
}

To use the default root, obtain it with Sdk.initialize(context). Continue to SDK construction only after the copy succeeds, using the same selected root, operator and hand. The profile location is <data-root>/glove/bone-configs/<encoded-operator>/<left|right>.yaml. Preserve ASCII letters, digits, - and _ in the operator, and encode every other UTF-8 byte as uppercase %HH. File picking, document-provider access, transfer and restoration belong to the app. The SDK loads the restored profile when the new instance is constructed.

Unified eight-gesture prompt alignment

2.0.0 corrects the mcp90_pip90 prompt from "natural fist" to bending the four non-thumb MCP and PIP joints palmward while keeping DIP joints near straight and the thumb relaxed, and aligns Chinese and English prompts across all eight gestures. See Capture for the full gesture table.

  • An ordinary fist curls the DIP joints, so old prompts do not confirm that historical samples match the required posture. If 1.9.0 or earlier captures curled the DIP joints or the recorded posture cannot be confirmed, force a full eight-gesture recapture after upgrading with new CaptureConfig(..., true, operatorId) or device.startCapture(packageIds, operatorId, true), then recalibrate affected targets. new CalibrationConfig(true) only refits existing frames and cannot fix old capture posture.
  • Compatible captures that already meet the required posture continue to be reused. The eight stage IDs, order, 30 frames per stage, non-optional status, capture profile, storage format, and per-package subset fitting are unchanged; UIs should render prompt / promptEn from the plan and progress directly instead of hard-coding "natural fist".

Standalone capture quality check and Android built-in Skeleton

2.0.0 bundles the built-in Skeleton runtime inside the Android Glove AAR, enabling both device-bound and standalone capture quality checking. See Standalone capture quality check for usage.

  • Existing CaptureConfig, captureStatus(), startCapture(), confirmation/retry/cancel calls, calibration calls, and capture reuse are unchanged. Applications using 1.9.0 released APIs do not need to change capture code or migrate data.
  • The unmerged draft capture.quality_check and capture-progress quality_feedback fields have been withdrawn; use the standalone quality session instead (device.createCaptureQualitySession() for online devices, or CaptureQualitySession.createCaptureQualitySession(side, deviceModel) for playback or explicit model overrides), passing 30-frame GloveHandPose windows to assessStage() and handling the returned CaptureQualityFeedback.
  • Applications that tried preview model names must replace qnbot, moxian, and qnbot_imu with CaptureQualityDeviceModel.STANDARD ("standard"), HMP_MX ("hmp_mx"), and HELIX ("helix"). Online devices using device.createCaptureQualitySession() can remove local model mappings.
  • Before calling the standalone CaptureQualitySession.createCaptureQualitySession(...) factory for playback or external input, call Sdk.initialize(context) on a worker thread so the SDK resolves the bundled runtime inside the AAR.

EMF millisecond time accessors

GloveHelixEmfTime adds fractional device-clock millisecond accessors ref(), error(), and bError() (for example, refUs=2500 corresponds to ref()=2.5 and errorUs=1 corresponds to error()=0.001). Call these methods in new code and remove manual / 1000.0 conversions. error() being null still means unknown, bError() equal to 0.0 remains a valid zero, and device-clock time still cannot be subtracted directly from Unix time or Sample.observedAt.

  • The microsecond fields refUs, errorUs, and bErrorUs and transitional aliases refMs(), errorMs(), and bErrorMs() are marked @Deprecated; use ref(), error(), and bError().
  • EMF JSON adds ref_ms, error_ms, and b_error_ms keys; upgrade the matched Glove 2.0.0 and Core 2.0.0 AARs together.

Upgrading from 1.8.1 to 1.9.0

Update the matching Glove/Core 1.9.0 dependencies and the pose, IMU and EMF read code. This release changes three reads: pose separates hand and wrist, IMU becomes per-sensor with a magnetometer, and EMF is a new channel. Rebuild with ./gradlew :app:assembleDebug and the app’s release/R8 build, then verify device data reads.

Pose: read hand and wrist separately

1.8.1 read path1.9.0 read path or action
payload.fingertipWorld / payload.fingertipLocalpayload.hand.fingertips
Device, side, time and quality fields on the pose payloadCorresponding fields within payload.hand
GloveFeaturePayloadGlovePosePayload, containing optional hand and wrist
payload.rootPoseRemoved. Use the hand's coordinateFrame and read the wrist separately from payload.wrist

Check hand and wrist presence, timing, freshness and validity independently. Wrist position uses meters and quaternionXyzw uses XYZW order. Hand and wrist update independently, so correlate them according to the application's timing requirements.

Java fields use gloveId, handSide, timestampMs, fingerNames, rawValidMask, heldMask, qualityFlags and coordinateFrame. Use Side.LEFT / Side.RIGHT for handSide, and check hand / wrist for null. The wrist quaternion field is quaternionXyzw.

IMU: per-sensor reads and magnetometer

Iterate over payload.imus, select sensors by id / location, then check each sensor's valid and fresh. The former payload-level validity, gyroscope and accelerometer fields move into individual sensors and their values. GloveImuValues.RawCounts provides gyroscopeRaw / accelerometerRaw; GloveImuValues.Physical provides gyroMdps / accelMg. Check the value type and process its units accordingly.

Read the optional magnetometer from payload.magnetometer. Its x/y/z values use raw counts and units is raw_counts. Preserve missing coordinates and valid zero values.

Raw EMF I/Q channel (emf)

device.emf() reads raw I/Q signed integral matrices acquired in pairs with hand pose. Correlate by source, session and pair sequence. Selecting this channel establishes paired acquisition, which subsequent reads retain. Select the channel on a worker thread. The channel requires a device that supports paired acquisition. See Raw EMF I/Q for fields and correlation.

Complete calibration reuse and pressure estimates

Use the optional TargetAlgorithm.calibrationKey configuration to replay a complete calibration file, reusing its algorithm configuration, bone configuration and calibration result. Export the file with Python/C++ export_calibration() and match its target and hand side.

Pressure retains 460 readings and adds matching estimatedKpa values in kPa. Estimates use an average palm curve, with raw readings 107–255 sharing an approximately 40.01 kPa software ceiling. Keep applying existing thresholds to readings when they distinguish values from 107 to 255.

Update the Glove/Core 1.9.0 AARs or matching offline directory together. After updating fields, run ./gradlew :app:assembleDebug and the Release/R8 build, retain AAR consumer rules, and verify pose, IMU, magnetometer, EMF reads and reconnection on the device. Check the exact Exo Core dependency before upgrading a composite application.

Upgrade from Android Glove 1.7.0

Confirm the current version, then migrate in the order below.

ItemDetail
Applies toAndroid Glove 1.7.0 → 1.8.1
Breaking changesGloveSdk / CoreSdk → Sdk; algorithm install uses Uri; remove the external verifier
StepsUpdate dependencies or offline directory → change construction code → migrate algorithm install → remove verifier → build
Verify./gradlew :app:assembleDebug, Release/R8 build, and read device data

Replace the Maven product dependency or the complete offline directory. Replace GloveSdk and CoreSdk construction with Sdk and select the device through the same domain view. Core 1.8.1 embeds certificate verification. Remove any separately added org.rustls:rustls-platform-verifier dependency or AAR, and remove its Maven repository if no other dependency uses it.

If the 1.7.0 app installed algorithm archives with new CoreSdk(...) and new AlgorithmPackageManager("glove").installFromArchive(Path), move installation to a worker thread, pass the original readable archive as a Uri to new AlgorithmPackageManager(context, "glove").installFromArchive(Uri), and use the returned package ID in TargetAlgorithm. See Reading retargeting data.

For an app that uses both products, replace its QnBot Maven repository with the complete Glove 1.8.1 offline directory and declare Glove 1.8.1 plus Exo 1.4.0. Use that directory’s Core 1.8.1.

If you still use the previous stable delivery, keep the external verifier declared by Core 1.7.0 and its Maven repository or complete offline directory. Remove it only after upgrading Core.

Run ./gradlew :app:assembleDebug and the app's release/R8 build, retaining the SDK consumer rules delivered by the AAR. Continue with Quick start for the expected data output.