A pure-Kotlin router module
Routing inside Android services
An interface to maintain, but routing is tested on the JVM in seconds.
9 files open · click a tab, or use prev / next at the bottom of the page
An offline SOS app that carries emergency messages phone to phone over a Bluetooth mesh.
> SOS messages that hop across phones with no internet and no cell signal.
In a flood or an earthquake, the network is the first thing to go, exactly when people need to call for help. Code Sangam 2026 DroidRush (problem 07) asked for a way to send an SOS without it.
Leyline turns nearby phones into a mesh: each one relays signed SOS packets over Bluetooth LE until one reaches someone who can help.
abhay@os ~ % what did I actually do?
[ ok ] exit 0 · 4 tasks · owner: abhay
Three numbers I'd put on a slide. Measured in production, not in a benchmark I wrote the night before.
mesh-core never imports android.*, so the router is tested on the JVM and driven by the simulator.
Routing inside Android services
An interface to maintain, but routing is tested on the JVM in seconds.
A fixed packet size
More connection bookkeeping, but every chunk fits the link it travels on (~180 bytes by default).
Polling the battery
Android-specific code, but no polling and the latest value arrives the moment we register.
Relaying for others is the first thing to give up when a phone is about to die. The sticky broadcast means no polling.
If I built it again, I'd change…
lessons.txt (END) — press q to quit
Oct 2026 · Code Sangam DroidRush