How darynongera/c22 works
This Android foreground service collects device health, network, process/app, location, and application-defined events, then batches JSON telemetry for delivery to a configurable HTTP(S) endpoint. The main path is service startup through JNI to the native engine, scheduled collection or location/event input, buffering, and HTTP posting. The graph retains distinct collection stages and the Android integration layer. Runtime flow is based on the README and sampled sources; location-listener and JNI bridge details are documented or indicated by the tree but their source was not sampled.
Main entry points: engine.cpp Telemetry engine · TelemetryService.java Foreground service · native_bridge.cpp JNI bridge · TelemetryLocationListener.java Location listener
Components 17
Android lifecycle
- Foreground service
java/com/telemetry/TelemetryService.java - Boot receiver
java/com/telemetry/BootReceiver.java - Location listener
java/com/telemetry/TelemetryLocationListener.java - Java native API
java/com/telemetry/Telemetry.java - JNI bridge
src/jni/native_bridge.cpp - Android context
src/jni/android_context.cpp
Telemetry collection
- Sampler scheduler
src/core/scheduler.cpp - Procfs collectors
src/core/procfs.cpp
Native engine
- Telemetry engine
src/core/engine.cpp - Custom event API
include/telemetry/event.h - Message buffer
src/core/buffer.cpp
Transport
- HTTP client
src/transport/http_client.h - Curl transport
src/transport/curl_client.cpp
Other components
- Android OS
- Application C++
- Telemetry endpoint
- Android system data
Connections 23
- Android OS → Boot receiver: boot broadcast
- Boot receiver → Foreground service: starts
- Android OS → Foreground service: starts service
- Foreground service → Java native API: attaches and starts
- Foreground service → Location listener: registers updates
- Android OS → Location listener: location fixes
- Location listener → Java native API: emits location
- Java native API → JNI bridge: native calls
- JNI bridge → Telemetry engine: starts and stops
- JNI bridge → Android context: sets context
- Application C++ → Custom event API: emits events
- Custom event API → Telemetry engine: queues event
- Telemetry engine → Sampler scheduler: registers samplers
- Sampler scheduler → Telemetry engine: runs callbacks
- Telemetry engine → Procfs collectors: reads metrics
- Procfs collectors → Android system data: reads proc and sys
- Telemetry engine → Android context: queries network and apps
- Android context → Android OS: queries Android APIs
- Telemetry engine → Message buffer: enqueues messages
- Telemetry engine → Message buffer: drains batches
- Telemetry engine → HTTP client: posts batches
- HTTP client → Curl transport: implemented by
- Curl transport → Telemetry endpoint: POSTs JSON