Shuhaib
モバイル基盤 / Flutter プラグイン2025 – 2026

エンタープライズ向け Flutter 位置情報追跡プラグイン

プラグイン作者 & リードモバイルエンジニア

技術的課題と解決策

プロジェクトのビジネス背景と技術的成果の詳細。

01. 課題 (The Problem)

Android独自の強力なタスクキルによる追跡中断や、屋内でのGPSドリフト、偽装GPSアプリによる不当な交通費・走行距離請求が課題でした。

02. 技術的挑戦 (The Challenge)

端末再起動やメモリ不足によるプロセス終了に耐え、誤差や改ざんのない高精度な移動距離を記録するプラグインを構築すること。

03. 解決策 (The Solution)

START_STICKYとBoot受信機による復帰機能、1次元カルマンフィルター、日次深夜ロールオーバー対応Room DB、型安全なセキュリティアラートを実装。

04. 成果 (The Result)

再起動からの100%自動復旧、静止時ドリフトゼロ、リリース版での位置偽装完全ブロック、全39件のテスト合格を達成。

Kotlinネイティブ位置情報トラッキングシステム構成

下図のシステムノードにカーソルを合わせると、技術仕様と担当責任の詳細を確認できます。

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.

主要な技術的課題

実装中に解決した低レイヤーインフラおよびシステム設計上のボトルネックの詳細。

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

開発の挑戦

課題提起 & 要件背景

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

調査と技術選定

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.

機能と実装

使用テクノロジー & ツール

Flutter
Kotlin
Android Foreground Service
Room SQLite
Kalman Filter
Robolectric

プロジェクト画面設計 & UIフロー

アプリケーションの主要チェックポイントとテレメトリデータパイプラインを可視化したレイアウト設計。

Screen mockup 1
チェックポイント 1
Screen mockup 2
チェックポイント 2
Screen mockup 3
チェックポイント 3
Screen mockup 4
チェックポイント 4