Shuhaib
Mobile Infrastructure / Flutter Plugin2025 – 2026

Enterprise Location Tracker Plugin

Plugin Author & Lead Mobile Engineer

Case Study Narrative

The business context and technical outcomes of this project.

01. The Problem

Workforce and delivery apps suffer 40%+ tracking loss due to OEM battery management killing background services, while indoor GPS drift and Fake GPS apps lead to fraudulent mileage reimbursement claims.

02. The Challenge

Engineering an Android background location engine that never drops a shift across low-memory kills or device reboots while maintaining sub-meter accuracy and fraud protection.

03. The Solution

Architected a native Kotlin foreground service with persistent state preservation, an on-device Kalman filter, Room SQLite daily rollover storage, and EventChannels for typed status and security alerts.

04. The Result

Delivered a rock-solid plugin with 100% reboot/kill survival, zero phantom drift, compliance-grade mock detection, and a 39-test automated test suite.

Native Kotlin Location Tracking System Flow

Hover over any system node in the diagram below to inspect its technical details and implementation responsibility.

Flutter / Dart

Flutter UI

Renders live trip progress, movement state, and security alerts.

Platform Channel

MethodChannel

Sends config parameters and invokes commands via typed runner.

Kotlin Service

Foreground Service

Persists active shifts across OS kills and device reboots (START_STICKY).

ADR-008 Security

Mock & GPS Guard

Blocks fake GPS apps in Release builds and detects mid-shift provider shutdowns.

Kotlin Algorithm

Kalman Filter

Eliminates stationary coordinate jitter and indoor drift on-device.

Room SQLite

Room Database

Stores daily odometer history with automatic midnight rollover & 7-day prune.

Typed EventBus

EventChannel

Streams live coordinates, movement states, and typed security alerts to Flutter.

Key Engineering Challenges

A detailed breakdown of low-level infrastructure and systems problems successfully solved during implementation.

Surviving aggressive OEM battery optimizers and task swipe-aways via START_STICKY & BOOT_COMPLETED
Eliminating stationary GPS coordinate jitter using an on-device 1D Kalman filter
Preventing travel allowance fraud by unconditionally discarding mock GPS apps in release builds
Atomic midnight shift rollover persisting yesterday's odometer under yesterday's calendar date

The Challenge

Problem Statement

Background tracking on Android must withstand aggressive OEM battery managers (Samsung OneUI, Xiaomi HyperOS), Doze deep idle mode, and mid-shift permission revocations.

OS Background Service Kills
Stationary GPS Coordinate Drift
Fake GPS & Mock Location Fraud

Research & Decisions

Typed Platform Channels

Centralized _invoke<T>() runner mapping native platform errors to strongly-typed Dart exceptions.

Robolectric JVM Test Harness

Full SQLite in-memory test harness executing 24 native Android assertions in under 4 seconds.

Features & Implementation

Technologies Used

Flutter
Kotlin
Android Foreground Service
Room SQLite
Kalman Filter
Robolectric

Project Interface Flow

Visual layout mapping the primary interface checkpoints and telemetry data pipelines of the application.

Screen mockup 1
Checkpoint 1
Screen mockup 2
Checkpoint 2
Screen mockup 3
Checkpoint 3
Screen mockup 4
Checkpoint 4