Life Cycle and State Management

The Damoov Telematics SDK enables mobile applications to detect and record driving activities. Its operation revolves around a flexible life cycle, allowing both automatic and manual tracking, depending on the use case. Understanding the SDK states and transitions is key to successful integration.

⚙️ SDK Life Cycle Overview

            +----------------------+
            |     SDK Disabled     |
            +----------------------+
                     |
              [Enable SDK]
                     v
            +----------------------+
            |    SDK Enabled       |<----------------+
            | - Heartbeats On      |                 |
            | - Automatic Tracking |                 |
            +----------------------+                 |
                     |                               |
        +------------+-------------+                 |
        |                          |                 |
 [Automatic Trip Start]   [Start Tracking]           |
        |                          |                 |
        v                          v                 |
+------------------+      +------------------+       |
|  Trip Recording  |<---->|  Manual Tracking |       |
+------------------+      +------------------+       |
        |                          |                 |
 [Automatic Trip Stop]     [Stop Tracking]           |
        +------------+-------------+                 |
                     |                               |
              [Disable SDK]--------------------------+
                     |
      (Stop active tracking, disable heartbeats,
     push unsent trips, then deactivate the SDK)

🧭 SDK States Explained

🔴 SDK Disabled

  • The SDK is inactive.
  • No tracking, no heartbeats, no background activity.

🟢 SDK Enabled

  • Heartbeat pings begin (used for health and session tracking).
  • If manual tracking is not defined, the SDK uses Automatic Tracking Detection:
    • SDK monitors device sensors for driving patterns.
    • When driving is detected, it starts recording a trip.
    • Automatically stops when driving ends.

🕹️ Manual Tracking Mode

Use StartTracking() and StopTracking() to control trips explicitly — ideal for workflows like:

  • Accept Order → Start Tracking → Complete Order → Stop Tracking

⚠️ Automatic Stop During Manual Tracking

  • If a user pauses driving for over 5 minutes, the SDK will automatically stop tracking — even in manual mode.
  • Prevents accidental long idle trips.

✅ Persistent Tracking (Bypass Auto Stop)

  • Use StartPersistentTracking() instead of StartTracking() to ignore pauses.
  • Ideal for scenarios like:
    • Couriers making multiple stops
    • Drivers with long idle times between trips
  • Tracking continues until:
    • You call StopTracking(), or
    • 10 hours of continuous tracking elapse

🕒 Shift-Based Tracking Example

Use Enable SDK / Disable SDK to track on-duty hours:

  • Begin work day: Call EnableSDK()
  • End work day: Call DisableSDK()
  • The SDK automatically tracks all trips between these two calls.

🔚 Disable SDK

Calling DisableSDK()Initiates a shutdown sequence:

  1. Stops any active trip (automatic or manual).
  2. Disables heartbeats.
  3. Pushes any unsent trip data to the server.
  4. Fully deactivates the SDK.

✅ Summary

MethodDescription
EnableSDK()Activates SDK, starts heartbeats, enables automatic tracking.
DisableSDK()Stops tracking, disables heartbeats, pushes data, deactivates.
StartTracking()Starts a manual trip; auto-stops after 5 mins of inactivity
StopTracking()Manually stops a trip.
StartPersistentTracking()Starts a manual trip that ignores inactivity pauses (max 10h duration)

For more, visit the platform-specific documentation:
📘 iOS Methods
🤖 Android Methods