The problem
Developers may assume one universal 'Google glasses SDK' exists for
every device. In practice, the available APIs depend on the target
Android XR device, release channel, form factor, and whether the
experience is a standard Android app or a specialized XR experience.
What this guide covers
This tutorial focuses on practical architecture and performance
engineering for production systems. The central principle is to measure
the complete pipeline, keep latency-sensitive work close to the
hardware, and make failure states visible to the operator.
Reference architecture
Flutter app for shared screens and workflows → Android host integration
for device-specific APIs → supported Android XR / wearable APIs →
service layer. Isolate experimental XR APIs behind interfaces so the
rest of the app remains stable.
Implementation plan
- Start from current official Android XR documentation and identify the exact device class and API surface you target.
- Build a native Kotlin sample that proves the required capability before adding Flutter complexity.
- Use Flutter for account, settings, history, and non-spatial UI; use native Android/XR components where the platform requires them.
- Define feature flags and capability detection instead of hard-coding a single device assumption.
- Keep the app useful on phones when XR hardware is absent or unsupported.
Example
abstract interface class DeviceCapabilities {\n Future<bool> supportsSpatialDisplay();\n Future<bool> supportsWearableInput();\n Future<bool> supportsCameraContext();\n}\n\n// UI should branch on capabilities, not brand-name assumptions.
The snippets are illustrative starting points, not drop-in integrations.
Match APIs and version requirements to the exact SDK, OS image, hardware
revision, and runtime in your project.
Performance checklist
- Measure end-to-end latency, not only one function or model invocation.
- Report p50 and p95/p99 latency alongside throughput, memory use, and dropped work.
- Bound queues and define what happens when consumers fall behind.
- Avoid repeated frame copies and expensive work on Flutter's UI isolate.
- Test sustained workloads after the device reaches thermal equilibrium.
- Keep UI state, device state, and robot state distinct.
- Add timeouts, cancellation, reconnection, and explicit stale-data indicators.
- Profile on the actual target hardware using a reproducible build.
Common pitfalls
- Do not invent or depend on undocumented APIs or assume a consumer SDK is generally available.
- Separate Android XR capabilities from Wear OS APIs; they are not interchangeable.
- Treat preview APIs as changeable and pin versions for reproducible builds.
Hands-on exercise
Create a capability matrix for phone, tablet, headset, and glasses
targets. Mark each feature as supported, unsupported, experimental, or
not verified.
Further reading
- Flutter performance best practices
- Flutter DevTools
- Android Developers
- NVIDIA Developer
- ROS 2 documentation
Useful Links
Website: www.v-modal.com
SDK Flutter: https://github.com/v-modal/vmodal_sdk_flutter
SDK Android: https://github.com/v-modal/vmodal_sdk_android
Discord: https://discord.gg/K72z28KUx
Top comments (0)