When mobile internet users in Cameroon buy a data bundle (Camtel Blue, MTN Mobile Surf, or Orange Good Deal), two questions come up every single day:
- Did my phone actually receive the megabytes I paid for, or did the bundle vanish early?
- Where in my house does the 4G LTE signal (
RSRP/SINR) actually pass through the walls, so I can leave my phone there as a Wi-Fi Hotspot while downloading?
To answer both questions with hardware-level proof, we built CheckMyMega CM — and along the way, we made a radical architectural decision: dropping our 85 MB Flutter shell in favor of a 0.99 MB 100% Native Kotlin APK talking directly to the Android baseband modem, NetworkStatsManager, 120 Hz MEMS sensors, and an on-device/cloud Gemma 4 AI auditor.
Here is the full engineering breakdown of how we built it, why cross-platform bridges failed on real radio hardware, and how we solved it.
1. Why Our Cross-Platform Prototype Failed on Real Hardware
In our initial hybrid build, two critical hardware limitations broke the user experience on a real Google Pixel 7 Pro connected to CAMTEL / Blue (Band 3 FDD 1800 MHz):
- Android's 30-second CellInfo Cache: Calling
TelephonyManager.getAllCellInfo()across a bridge returned cachedRSRPvalues that stayed frozen at-81 dBmwhile walking across the living room. - Compass Gimbal Lock & 120 Hz Frame Jitter: Holding the phone upright (
pitch > 38°) caused standard Euler angles fromSensorManager.getOrientation()to flip wildly. Furthermore, serializing 120 Hz sensor events across inter-process bridges introduced noticeable jitter on smooth OLED screens. - Wi-Fi Socket Pollution: During speed tests, Android routes all traffic through Wi-Fi if available. To measure real SIM throughput without forcing the user to toggle airplane mode or disable Wi-Fi, the socket must bind directly to
NetworkCapabilities.TRANSPORT_CELLULAR.
2. Architecture of the 100% Native Kotlin Engine (0.99 MB APK)
flowchart LR A["4G/5G Baseband Modem\n(TelephonyCallback + requestCellInfoUpdate 750ms)"] --> D["NativeHardwareEngine.kt"] B["120 Hz 3D MEMS Sensors\n(RotationVector + Barometer + ZUPT Filter)"] --> D C["Linux Kernel Telemetry\n(NetworkStatsManager + content://sms/inbox)"] --> D D --> E["120 Hz Hardware Canvas\n(WayfinderCompassRadarView)"] D --> F["Per-App UID Auditor\n(WhatsApp, ChatGPT, Hotspot)"] D --> G["Gemma 4 AI Engine\n(Google AI Studio / Local Ollama)"] Bypassing the Modem Cache (TelephonyCallback + requestCellInfoUpdate)
Starting with Android 10 (API 29) and Android 12 (API 31), getting sub-second RSRP (dBm), SINR (dB), RSRQ (dB), CQI, and Timing Advance updates requires combining TelephonyCallback.SignalStrengthsListener with active requestCellInfoUpdate() calls on a dedicated background executor:
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) { tm.requestCellInfoUpdate(bgExecutor, object : TelephonyManager.CellInfoCallback() { override fun onCellInfo(cellInfo: MutableList<CellInfo>) { parseCellInfoList(cellInfo) notifyUi() } }) } Even when a SIM card has 0 FCFA / no active data bundle, the 4G LTE physical layer stays attached to the cell tower (Reference Signals). This allows our RF Oscilloscope to map indoor wall attenuation room by room (Salon, Près Fenêtre, Chambre, Balcon) with zero synthetic data.
Forced 4G Cellular Sockets (TRANSPORT_CELLULAR)
To prevent home Wi-Fi from polluting the SIM measurement, we acquire a dedicated cellular network handle:
val req = NetworkRequest.Builder() .addTransportType(NetworkCapabilities.TRANSPORT_CELLULAR) .addCapability(NetworkCapabilities.NET_CAPABILITY_INTERNET) .build() cm.requestNetwork(req, object : ConnectivityManager.NetworkCallback() { override fun onAvailable(network: Network) { val conn = network.openConnection(URL("https://speed.cloudflare.com/...")) as HttpURLConnection // Real cellular throughput test executed strictly over SIM 4G! } }) 3D Tilt-Compensated Wayfinder Compass + Zero-Velocity Update (ZUPT)
Drawing inspiration from Android sensor engineering articles on DEV — such as Master Android Sensors with Jetpack Compose and How I Solved Phantom Pocket Touches on Android — we implemented quaternion coordinate remapping when tilted past 38°, combined with a ZUPT (Zero-Velocity Update) filter that freezes linear acceleration drift whenever the phone is stationary.
3. Real Telecom Auditing via NetworkStatsManager & Gemma 4 AI
Instead of synthetic guesswork, CheckMyMega CM audits real usage by cross-referencing:
- Carrier SMS messages (
content://sms/inbox) for activations and expirations. - Kernel byte counters via
NetworkStatsManager.querySummary(ConnectivityManager.TYPE_MOBILE, ...). - Per-app UID consumption (
WhatsApp,ChatGPT,YouTube,Wi-Fi Hotspot Tethering) paired with authentic system icons viaPackageManager.getApplicationIcon().
Gemma 4 Telemetry Synthesis
The structured telemetry is synthesized by Gemma 4 (supporting gemma-4-27b-it on Google AI Studio, OpenRouter, or local on-device gemma4:e4b via Ollama). The model produces an unvarnished audit comparing the operator's promised megabytes against bytes delivered by the baseband layer:
{ "isp": "Camtel / Blue", "planName": "Surveillance SIM Directe (24h)", "osMeasuredDecimalMb": 7.7, "topApps": ["Partage de Connexion (4.7 Mo)", "WhatsApp (0.5 Mo)"], "bestSpot": "Près Fenêtre (-79 dBm, SINR 8 dB, ~24.5 Mbps)" } 4. Atomic Git Commits & Single-Responsibility Protocol
We enforced strict atomic commit discipline under the "AND / ET" principle (every commit encapsulates exactly one logical intention). The migration was recorded across 10 clean commits:
c898220 chore(deps): add google_fonts package for UI typography 9e0b4f5 feat(domain): add 4G signal radar models with real SIM telemetry d0b7655 feat(ui): add signal compass view to Flutter audit dashboard 2de18a5 test(audit): update widget tests for real SIM audit workflow 83a802b chore(android): configure standalone native Kotlin Gradle build 389f95f feat(android-res): replace launcher assets with vector radar icon debde39 feat(native-models): add multi-SIM, SMS, 4G RF telemetry models 7b89f10 feat(native-engine): add 120Hz sensor engine with Gemma 4 client 2113780 feat(native-views): add 120Hz Canvas compass with vector icon views fde7920 feat(native-ui): implement native FinTech UI with Gemma 4 settings 5. MLH Global Hack Week: Builders Week & What's Next
We registered CheckMyMega CM as an official project for MLH Global Hack Week: Builders Week (November 6–12, 2026).
The project is now completely independent of heavy frameworks, compiling into a featherweight 0.99 MB native APK with zero external runtime dependencies.
What are your go-to strategies for accurate radio telemetry and sensor fusion on Android? Let us know in the comments below!




