cd /news/robotics/building-an-offline-first-robot-cont… · home › topics › robotics › article
[ARTICLE · art-139881] src=dev.to ↗ pub= topic=robotics verified=true sentiment=· neutral

Building an Offline-First Robot Control App with Kotlin

A developer published a tutorial for building an offline-first Kotlin/Android control layer for robotics and Physical AI systems, using Jetpack Compose, ViewModel/Flow, and a repository pattern to sit between the Android UI and a ROS 2, NVIDIA Jetson, or AI backend. The design queues commands with unique IDs for replay on reconnect, blocks dangerous physical actions while the robot's connection is unverified, and keeps hardware-specific code behind interfaces so the app can be extended with computer vision models, smart-glasses SDKs, or multimodal AI backends.

by read1 min views3 publishedSep 25, 2026

In this tutorial, you will build a practical Kotlin/Android component for a robotics or Physical AI system. The design emphasizes asynchronous processing, lifecycle-aware state, real-time data handling, observability, and safe separation between the Android interface and physical robot control.

Android Kotlin + Jetpack Compose
             ↓
       ViewModel / Flow
             ↓
      Repository / API
             ↓
   ROS 2 / Jetson / AI Backend
             ↓
        Robot System
data class LocalRobotState(
    val connected: Boolean = false,
    val pendingCommands: List<String> = emptyList()
)

Use a local persistence layer appropriate to your application so the UI can open without a network connection.

data class PendingCommand(
    val id: String,
    val command: String,
    val createdAt: Long
)
if (connected) {
    pendingCommands.forEach { send(it) }
}

Use unique command IDs so a reconnect does not accidentally execute the same command twice.

Do not allow dangerous physical actions to queue indefinitely while disconnected. Some commands should be disabled entirely when the robot cannot be verified as connected.

Make it obvious whether the user is operating the live robot, viewing cached information, or waiting for synchronization.

StateFlow for observable UI state. The resulting Kotlin layer can be extended with real ROS 2 bridges, NVIDIA Jetson services, computer vision models, smart-glasses SDKs, or multimodal AI backends. Keep hardware-specific code behind interfaces so the Android application remains maintainable as the robotics stack evolves.

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

── more in #robotics 4 stories · sorted by recency
── more on @kotlin 3 stories trending now
sponsored brought to you by zahid.host 4,200+ EU-deployed projects
reading about agents? ship yours in a single git push.

Run your AI side-project on zahid.host

EU-based hosting, git-push deploys, automatic HTTPS, no cold starts. Free tier with a custom domain — perfect for shipping the agent you just read about.

$git push zahid main
→ Live at https://your-agent.zahid.host ✓
Get free account → Pricing
from €0/mo · no card required
LIVE [news/building-an-offline-…] indexed:0 read:1min 2026-09-25 · —