Sampark · the SDK

The detection layer. Nothing more, nothing less

Your behavior change program needs three things scored on every trip — phone use, hard braking, and rapid acceleration. Sampark is the part that makes sure all three are captured, on the devices your drivers actually carry, without a trip getting missed.

Phone use · Braking · AccelerationThree signals, scored per trip
iOS & AndroidOne SDK, same behaviour on both
Budget Android OEMsThe devices your fleet uses
1,00,000 kmLogged and validated in the field
What Sampark detects

Three behaviors. The ones that precede most accidents

Three signals that behavioral research and field data consistently identify as accident precursors. Accuracy on a narrow target beats guesswork across a broad one.

ML model · live

Phone use

ML on-device identifies active phone use — texting, scrolling, calling without hands-free — and separates it from incidental handling. No network required. A fleet manager can’t coach a driver on something they can’t see. This makes it visible.

Validated · live

Hard braking

Detected from accelerometer and gyroscope, time-aligned with GPS. Threshold calibrated to your fleet before the program goes live — a delivery van on a slope is not a motorcycle at speed. Hard braking responds to coaching faster than any other signal.

Validated · live

Rapid acceleration

Same sensor pipeline as hard braking. Aggressive acceleration after stops predicts hard braking later in the same trip — they’re behaviorally paired. Drivers who score high on both are the highest-priority intervention targets.

Speeding is the next signal we are adding to the pipeline. We are not claiming it until the model is validated. That is the standard we hold for everything on this page.

The devices your fleet uses

Tested on the phones that break every other SDK

Most SDKs are tested on flagship devices. Most fleets run on budget Android OEMs — the ones whose process killers break background detection within weeks of deployment. We built Sampark on those devices first.

Device tier · how aggressively it kills apps Logged Status What we work around
Tier 1 · aggressive killer Custom Android skin · game & task manager kill
21,000 km Calibrated

Its game-mode and task-manager utilities kill background apps within 10 minutes of inactivity. We use a persistent foreground service plus activity-recognition wake-ups to survive both.

Tier 2 · deep doze Custom Android skin · deep doze variant
18,000 km Calibrated

Auto-start permission, battery saver lockout, and background restriction stacked three layers deep. Our install flow walks the user through three explicit toggles.

Tier 3 · inherited lockdown Shares its parent skin’s deep-doze engine
13,000 km Calibrated

Inherits the same aggressive memory policy as Tier 2, with stricter app-lock defaults. Same fix pattern, with one extra prompt for app-lock unbinding.

Reference · stock OS Reference behaviour
48,000 km Reference

Stock Android and iOS — the easy case. Used as the calibration reference; if it fails here, we don’t ship.

Tier 4 · in pilot Custom Android skin · dedicated background manager
in pilot Pilot

Currently calibrating against pilot fleet. Its background-restriction layer sits above the Android one; expected to ship calibrated by Q3 2026.

Why it holds up

Trips that don’t get missed

Every behavioral profile is built from trips. A missed trip is a gap in the coaching conversation. Here’s how we ensure trips complete.

01

When drivers quit the app, detection recovers

Force-quit recovery within seconds. The driver doesn’t reopen the app — the trip completes.

Automatic recovery No driver action Trip always completes
02

All three signals, one trip

One integration, three signals, every trip — not partial data, not separate SDKs to combine.

Per trip All three signals iOS and Android
03

Calibrated to your fleet, not ours

Thresholds calibrated against your pilot data — your devices, your geography, your drivers. Not the number that looked good in the demo.

Your devices Your geography Your drivers
04

Data arrives, even without connectivity

Stored on-device, uploaded when signal returns. Rural areas, tunnels, low-signal zones — no trip is lost.

On-device storage Uploads when ready No gaps
Integration

One init. Same shape on iOS and Android

One init call, same API surface on iOS and Android. If your team has integrated CMT or Zendrive before, the shape will be familiar. The code samples below are the actual integration — not a simplified version.

  • Single entry point. No subclassing, no service registration, no manifest gymnastics. Sampark.configure(...) is everything.
  • Identical signatures. If you’ve done iOS, the Kotlin reads like a translation. Same callbacks, same field names, same semantics.
  • Strongly typed events. Trip, score, sensor health, permission state. Every callback ships a versioned payload with a predictable shape your code can rely on.
  • Backend-agnostic. Use our backend or yours. The SDK just emits signed JSON to whichever endpoint you configure.
// iOS · Swift
import Sampark

let sampark = Sampark.configure(
    tenant: "acme-insurance",
    region: .in_south,
    onTripStart: { trip in
        analytics.log("trip.start", trip.id)
    },
    onTripEnd: { trip in
        backend.submit(trip)
    }
)

sampark.setUser(id: currentDriver.id)
sampark.start()
// Android · Kotlin
import com.sastram.sampark.Sampark

val sampark = Sampark.configure(
    tenant = "acme-insurance",
    region = Region.IN_SOUTH,
    onTripStart = { trip ->
        analytics.log("trip.start", trip.id)
    },
    onTripEnd = { trip ->
        backend.submit(trip)
    }
)

sampark.setUser(currentDriver.id)
sampark.start()
// Backend · trip.completed payload
{
  "version": "2",
  "event": "trip.completed",
  "trip": {
    "id": "trip_01HZ8X7K4M...",
    "user_id": "drv_aaa111",
    "start_at": "2026-05-03T08:42:11Z",
    "end_at": "2026-05-03T09:05:38Z",
    "distance_km": 12.4,
    "score": { "overall": 82,
                "smoothness": 88,
                "focus": 76 },
    "placement": "mounted",
    "transport": "car"
  },
  "signature": "sha256=..."
}
Honest envelope

What we admit. What we fix

A detection gap is a profile gap. Every SDK has failure modes. Vendors that don’t name them haven’t shipped at scale.

Will degrade

Airplane mode for two weeks

We save trip data locally as it comes in, but at some point the phone running low on storage or the OS clearing old data wins. Trips after day 14 may be partially lost on aggressive devices.

Fix: Lower-frequency local heartbeat & explicit user prompt at day 7.

Heavy use envelope

Heavy commute users see more drain

Idle CPU is 0%. But a 90-minute daily commute with hard maneuvers will use measurable battery — on the order of 3-5% per hour of active driving.

Fix: We show you the per-driver envelope on call, not a marketing average.

Solved

Force-kill

The big one. Most SDKs lose detection when the user swipes the app away. Sampark uses geofence wake-ups and activity-recognition transitions to recover within 30-90 seconds of motion.

Fix: Layered recovery, validated across 1,00,000 km of real-world data.

FAQ

Questions, answered

What platforms does Sampark support?
Native iOS and Android, sharing a Rust core — one init call, same API surface on both platforms.
What happens if the OS force-kills the app?
Sampark uses a persistent foreground service plus geofence and activity-recognition transition wake-ups to recover within 30–90 seconds of the next motion event, even after a hard kill. This is the most common failure mode for other SDKs, which is why we test against it first.
How long does integration take?
Teams that have integrated CMT or Zendrive before are typically productive within an afternoon.
Where does trip data get processed?
On-device, by default, after the trip ends. The phone does the detection and scoring work; the backend is for upload and reporting. See Data Residency for the full picture.
Get integration access

Ready to see what it detects on your fleet?

30 minutes with the engineer who’d own your integration. Bring your device list — we’ll tell you exactly what to expect, including where the SDK will degrade.

Book a call