Skip to main content

Device SDK

ArborXR’s Device SDK lets apps on a headset talk to the ArborXR client running on the same device. Native apps can bind to the AIDL interface (ISdkService.aidl), while Unity apps use the SdkBehaviour base class.

Setup

  • Unity ≤ 2019.x: ensure your Gradle plugin classpath is ≥ 3.6.0 (see Android Gradle plugin docs).
  • Unity package: import via Window → Package Manager → “+” → Add package from disk…, then select the package.json in the SDK folder.

Download

Click here to download the latest SDK

Capabilities (API surface)

Device info

  • getDeviceId() → string — ArborXR UUID for this device.
  • getDeviceTitle() → string — admin-assigned device name.
  • getDeviceSerial() → string — OEM serial number.
  • getDeviceTags() → string[] — tags from the ArborXR portal.
  • getFingerprint() → string — device fingerprint.
  • getCustomFields() → string[] — custom fields added to the device in the ArborXR Web Portal. Returns interleaved name/value pairs (e.g.[name0, value0, name1, value1]). Returns an empty array if no custom fields are assigned.

Organization info

  • getOrgId() / getOrgTitle() / getOrgSlug() → string — organization identifiers.
  • getMacAddressFixed() / getMacAddressRandom() → string — hardware MAC and current randomized MAC.

SSO

  • getIsAuthenticated() → boolean — whether SSO is active.
  • getAccessToken() / getRefreshToken() → string — SSO tokens (use securely).
  • getExpiresDateUtc() → datetime — token expiry in UTC.

Device state

  • getHeadsetBatteryPercentage() → int — headset battery charge as a percentage (0–100). Returns -1 if unavailable.
  • getControllerBatteryPercentages() → int[] — battery charge of connected controllers as percentages (0–100). Returns -1 per controller if unavailable. Returns an empty array if unsupported on this device.
  • getAudioVolume() → int — current media volume as a percentage (0–100).

Device control

  • setAudioVolume(int volume) → int — sets the media volume. volume is a percentage (0–100). Returns 0 on success, -1 on error.
  • reboot() → int — reboots the device. Returns 0 on success, -1 on error.
  • shutDown() → int — shuts down the device. Returns 0 on success, -1 on error, -2 if unsupported on this device. Supported on Meta and PICO devices only.

Unity usage example

using XRDM.SDK.External.Unity;

public sealed class ArborxrSdkExample : SdkBehaviour
{
protected override void OnEnable() {
base.OnEnable();
Connect(new Callback());
}

private sealed class Callback : IConnectionCallback
{
public void OnConnected(ISdkService svc) {
var deviceId = svc.GetDeviceId();
var orgName = svc.GetOrgTitle();
// TODO: use IDs/tokens to personalize app behavior
}
public void OnDisconnected(bool isRetrying) { /* handle retry/backoff */ }
}
}

Unity integrates via SdkBehaviour; native apps integrate the AIDL service directly.

Notes & best practices

  • Treat access/refresh tokens as secrets; never log or expose them to end users.
  • If you rely on MAC addresses, prefer the fixed hardware MAC for stable identity; randomized MACs can change per network/session.