-
-
Secure Direct Messaging Layer: Peer-to-peer end-to-end encrypted (E2EE) chat channel showing real-time multi-hop verification.
-
Ad-Hoc Peer Discovery Layout: App actively scanning for decentralized mesh routing nodes using Google Nearby Connections API.
-
Zero-Infrastructure Emergency SOS Broadcast: Real-time, localized alert packets flooding to all active adjacent nodes concurrently.
💡 Inspiration
In emergency situations, disaster zones, or infrastructure-denied environments, modern communication entirely collapses. Seeing how critical updates fail to propagate when cellular networks and internet backbones go down inspired us to build RelayNet. We wanted to engineer a resilient framework that empowers standard mobile devices to form independent, ad-hoc survival communication webs instantly.
🛠️ How we built it
RelayNet is engineered natively using Kotlin and Jetpack Compose for a highly responsive, modern frontend mobile interface. The underlying networking grid is powered by Google's Nearby Connections API configured with a P2P_CLUSTER strategy to dynamically negotiate ad-hoc hardware connections over Bluetooth, BLE, and localized Wi-Fi Direct. For localized state persistence, we integrated a Room Database wrapped with SQLite, utilizing asynchronous Kotlin Coroutines to offload complex networking handshakes and database interactions from the UI thread. Cryptographic safety is maintained via automated public key exchanges for end-to-end encrypted direct chats alongside a specialized open SOS broadcast data pipeline.
🧠 What we learned
We learned the practical engineering complexity of managing low-level hardware communication threads across different device manufacturers. Handling data persistence asynchronously within fluctuating topology layers taught us how to optimize state mutations carefully. We also discovered how strict background limits on modern Android operating systems require meticulous architectural planning to maintain consistent data routing across dynamic mesh vertices.
🚧 Challenges we faced
- Android 14+ Lifecycle Crashes: Encountered system execution crashes traced directly to a missing
foregroundServiceTypedeclaration on our core mesh processing service under modern OS policies. - Swallowed Database Operations: Messages silently vanished during dense socket traffic because critical Room database writes were mistakenly running on the main UI thread inside a synchronous Bluetooth callback.
- Ciphertext Delimiter Collision: Encrypted packets failed parsing because our raw ciphertext generation unknowingly utilized the
|symbol as an internal separator, colliding with the outer protocol's formatting wrapper. We resolved this by encoding the payload packets into a clean Base64 opaque token layer. - Stale Discovery States: Devices required an aggressive application force-stop to re-establish connections after being pushed to the background, which we patched by cleanly lifecycle-managing and restarting active mesh discovery routines inside
onResume(). - Transport-Layer Variability: Navigating the technical reality that "pure offline" spans a wide performance spectrum—where Wi-Fi-based discovery channels still seek localized routers, while standard Bluetooth interfaces operate with hard architectural distance limits.
🏅 Accomplishments that we're proud of
- Provable Zero-Infrastructure Mesh: Successfully established a verifiable, multi-hop mesh array where adjacent physical devices seamlessly route fully encrypted communications with absolute zero internet access, zero cellular signals, and no central coordination server.
- Rapid Bug Squashing: Successfully tracking down, refactoring, and fixing four critical invisible architectural flaws (the startup lifecycle crash, the silent background threading lockup, the payload delimiter collision, and the stale-session state drop) in a single high-intensity sprint.
🔮 What's next for RelayNet
We plan to scale RelayNet by optimizing the routing protocols to handle dense node meshes without data collisions. Additionally, integrating battery-efficient asset broadcasting and compressed media sharing features will transform this into a robust operational toolkit for real-world first responders.
Built With
- aes
- android
- android-studio
- bluetooth
- encryption
- google-nearby-connections-api
- jetpack-compose
- kotlin
- kotlin-coroutines
- material-design-3
- room
- rsa
- sqlite
- wifi-direct

Log in or sign up for Devpost to join the conversation.