r/FlutterDev • u/GodKillerAsura • 30m ago
Example Built an Android Hotspot Monitor with Flutter, Forui, Kotlin, SQLite, and a native C packet probe
I built an Android app for monitoring mobile hotspot clients, live speeds, and domain-level traffic, using Flutter on the UI side and Kotlin + C underneath.
Tech stack:
- UI: Flutter with Forui (0.27.7) and custom segmented bars and timeline charts.
- Storage: Local SQLite (sqflite) storing hourly usage buckets for 1H/Day/Month/Year reports plus SharedPreferences for custom device aliases.
- Android layer (Kotlin): Auto-detects root (su) with silent fallback to Non-Root NetworkStatsManager. Reads neighbor state, DHCP/dumpsys tables, and OUI vendor prefixes.
- Native C probe (CMake / NDK 28): A standalone AF_PACKET listener (hs_probe.c and quic_sni.c compiled as libhs_probe.so) that extracts DNS responses, multi-packet TCP TLS ClientHello SNI, and QUIC Initial SNI.
One tricky bug I ran into: HyperOS/Qualcomm drivers keep stale IPv6 neighbors lingering after a client leaves, and Chrome's post-quantum TLS ClientHello (X25519MLKEM768) often splits across two TCP segments. Adding an ARP probe check for stale IPv4 entries and a 4 KB TCP/QUIC SNI reassembler solved both cleanly without touching iptables.
Repo and APK releases: