Shuhaib
البنية التحتية للمحمول / إضافة Flutter2025 – 2026

إضافة تتبع الموقع الميداني المتقدمة لـ Flutter

مؤلف الإضافة ومهندس المحمول الرئيسي

المشكلة التقنية والحل

سياق العمل الهندسي والنتائج التقنية لهذا المشروع بالتفصيل.

01. المشكلة (The Problem)

تتوقف تطبيقات المناديب والتوصيل عن العمل بسبب مدراء البطارية الصارمين، بينما يؤدي اهتزاز GPS وتطبيقات الموقع الوهمي إلى مطالبات تعويض احتيالية.

02. التحدي الهندسي (The Challenge)

بناء محرك تتبع صامد ينجو من إيقاف الذاكرة وإعادة تشغيل الجهاز دون تراكم مسافات وهمية أو ثغرات أمنية.

03. الحل الهندسي (The Solution)

تطوير Foreground Service بلغة Kotlin مع استئناف تلقائي، وفلتر كالمان على الجهاز، وتخزين يومي في 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

مخطط واجهات وتدفق النظام

مخطط مرئي يوضح نقاط التحقق الرئيسية في الواجهة وخطوط نقل البيانات والقياسات للتطبيق.

Screen mockup 1
نقطة فحص 1
Screen mockup 2
نقطة فحص 2
Screen mockup 3
نقطة فحص 3
Screen mockup 4
نقطة فحص 4