Server-Sent Events on Android: Real-Time Streams That Survive the Factory Floor
Jasveen SandralDroidKaigi 2025 Speaker | Industrial Android, Toyota Group Japan | Ruby Core Contributor
After my DroidKaigi 2025 talk on industrial RFID, the most asked question was the one I had not answered on stage: how does the data actually stream from the factory floor to the Android dashboard in real time? This is that answer. For real-time on Android, WebSocket dominates the conversation. But for one-way server-to-device streams (which is most real-time monitoring), Server-Sent Events (SSE) is simpler, more reliable, and surprisingly underused on Android. In Japan's automotive manufacturing context, SSE is the right tool for real-time factory monitoring on Android dashboards. This talk is built from that working experience. The investigation went deeper. Over two weeks in April 2026, I contributed four pull requests to the Rage Ruby web framework's SSE implementation, fixing three connection leaks across three different stream types (formatted, raw, single-value), each requiring a different fix pattern: rescue versus ensure semantics, guard conditions for async fiber boundaries, telemetry-aware cleanup. All four PRs are publicly merged on GitHub with full review history. The server-side investigation revealed exactly what mobile clients need to handle correctly. I will explain how to build SSE consumers on Android that survive a production shift: - What the SSE specification actually guarantees versus what is the client's responsibility - Where Android's HTTP stack handles automatic reconnection and where it does not - Designing for backpressure when the server outpaces the device - Offline buffering patterns when factory WiFi drops mid-shift - The error recovery state machine that separates a robust real-time client from a fragile one I will also compare SSE against WebSocket for industrial monitoring and explain when each wins. Attendees leave with a production pattern from someone who has worked both sides of the wire.
Intended audience
People who: - Build Android apps that consume real-time data streams from backend services - Have implemented WebSocket and want to understand when SSE is the better choice on Android - Need offline-tolerant real-time on mobile (industrial monitoring, dashboards, live feeds) - Want to understand how server-side connection lifecycle bugs manifest on the Android client - Saw my DroidKaigi 2025 industrial RFID session and want to know how the dashboard actually streams data in real time - Are interested in cross-stack patterns where you must understand both server and client to ship correctly