Minimal Unity sample app demonstrating the Connections SDK for rowing machine integration.
- Module initialization with
ConnectionsModule.Create - Device scanning via
connections.Devices(...), filtered to rowing machines - Connecting to / forgetting a rowing machine via
connections.Connect/connections.Forget - Live metrics via the typed
connections.Rowingstreams: distance and drive (power, stroke rate) - Fake device support for running without hardware (debug builds)
Every callback is delivered on the Unity main thread, so the UI is driven straight from the subscriptions, and each subscription is an IDisposable torn down in OnDestroy.
- Unity 2022.3.62f3 (see
ProjectSettings/ProjectVersion.txt) - Android 8.0+ (API 26) device — the SDK floor; this sample is Android-only
- MoveLab Nexus credentials (contact MoveLab to obtain)
- Clone this repo.
- UPM registry token — the package is served from MoveLab's private npm registry on Nexus. Authenticate by adding your token to
~/.upmconfig.toml(UPM does not read.npmrc):[npmAuth."https://nexus.mls-cdn.net/repository/movelab-npm/"] token = "<base64 of user:password>" alwaysAuth = true
- Maven credentials — the package's native
.aarand its transitivemls.*artifacts resolve from the Nexus Maven repo at Android build time. Add them to~/.gradle/gradle.properties(or setNEXUS_USER/NEXUS_PASSWORD):nexusUser=<your username> nexusPassword=<your password> - Open the project in Unity and switch the platform to Android (
File ▸ Build Settings ▸ Android). - Open
Assets/Scenes/BasicConnection.unityand press Play in the Editor, or build and run on an Android device (the host prompts for BLE permissions at runtime).
In the Editor and in debug builds a simulated ("Fake") rowing machine appears automatically in the device list — no hardware required. Tap Connect and the distance + drive labels update as it rows.
The SDK is private — there are two credential surfaces, both pointing at the same MoveLab Nexus host:
- UPM (package) — the
mls.connections.unitypackage is an npm package onmovelab-npm. UPM authenticates via the token in~/.upmconfig.toml. - Gradle (native artifacts) — the bundled
.aarand the transitivemls.*dependencies are Maven artifacts onmovelab. The Android Gradle build authenticates vianexusUser/nexusPassword(or theNEXUS_USER/NEXUS_PASSWORDenvironment variables).
Neither ~/.upmconfig.toml nor ~/.gradle/gradle.properties lives in the repo, so credentials are never committed. Contact MoveLab to obtain credentials.
The native side is pulled in by the External Dependency Manager for Unity (EDM4U), which resolves the SDK .aar and its transitive mls.* closure through Gradle at build time. The pieces:
Packages/manifest.json— the MoveLab scoped registry (mls.connections→movelab-npm) and the pinnedmls.connections.unityversion, plus EDM4U from OpenUPM.Assets/Plugins/Android/settingsTemplate.gradle— the authenticated Nexus Maven repository.Assets/Plugins/Android/gradleTemplate.properties—-Xss16m(D8 dexes the SDK's Kotlin with deep recursion and overflows the default thread stack without it).
| File | Purpose |
|---|---|
Assets/Scripts/ConnectionsSample.cs |
Core SDK integration: discovery, connect, rowing streams |
Assets/Scenes/BasicConnection.unity |
A camera + the sample component |
Assets/Plugins/Android/ |
Gradle templates: Nexus repo + -Xss16m |
Packages/manifest.json |
SDK package + registry declaration |