IMS SDK Product Document
  • Getting Started
    • iOS
      • Requirements
      • Importing the SDK
      • Permissions
      • Initializing the SDK
      • Using the SDK
        • Using Push Notifications
          • Push notification certificate and profile creation guide
    • Android
      • Requirements
      • Import the SDK
      • Permissions
      • Obfuscation
      • Initialize the SDK
      • Using the SDK
        • Trip Detection and Recording
          • Trip Manager Configuration
            • Using TripDetector.AWARENESS
            • Trip Manager Device Support
          • Trip Manager Control
          • Trip Manager Status
        • Bluetooth and Other Devices
    • React Native
      • Requirements
      • Import the SDK
      • Permissions
      • Initialize the SDK
        • Android
        • iOS
      • Using the SDK
        • Trip Manager
        • Device service
    • Flutter
      • Requirements
      • Import the SDK
      • Permissions
      • Initialize the SDK
      • Using the SDK
  • Security
  • App misuse
  • Time Driven Without Phone
  • DriveSync Portal
    • Requirement
    • User
    • Device
    • Driving Alert
    • Push Notification
    • Invitations
    • Subscription
    • Trip
    • Location
    • Driving Summary
    • Discount
    • Scoring
    • Vehicle
    • Leaderboard
    • Rewards
    • Submit consent to EULA
    • Legal documents and FAQ
    • Named Driver
    • Wedge
  • Known Issues
    • iOS
    • Android
      • 1.17.0
      • 1.18.0
      • 1.22.0
  • Releases
    • 1.13.0
      • iOS
      • Android
    • 1.14.0
      • Android
    • 1.15.0
      • iOS
      • Android
    • 1.15.1
    • 1.16.0
      • iOS
      • Android
    • 1.17.0
      • iOS
      • Android
    • 1.18
      • iOS
      • Android
    • 1.18.1
    • 1.19.0
      • iOS
      • Android
    • 1.20.0
      • Android
      • iOS
    • 1.21.0
      • Android
      • iOS
    • 1.22.0
      • Android
      • iOS
    • 1.23.0
      • Android
      • iOS
    • 1.24.0
      • Android
      • iOS
    • 1.24.1
      • iOS
  • Migration
    • iOS
      • 1.15.x -> 1.16.0
      • 1.16.0 -> 1.17.0
      • 1.17.0 -> 1.18.0
      • 1.18.0 -> 1.19.0
      • 1.19.0 -> 1.20.0
      • 1.20.0 -> 1.21.0
      • 1.21.0 -> 1.22.0
      • 1.22.0 -> 1.23.0
      • 1.23.0 -> 1.24.0
      • 1.24.0 -> 1.24.1
    • Android
      • 1.15.x -> 1.16
      • 1.16 -> 1.17
      • 1.17 -> 1.18
      • 1.18 -> 1.19
      • 1.19 -> 1.20
      • 1.20 -> 1.21
      • 1.21 -> 1.22
      • 1.22 -> 1.23
      • 1.23 -> 1.24
  • Support
Powered by GitBook
On this page
  • Enable Trip Detection and Recording
  • Programmatically Starting and Stopping Trips
  1. Getting Started
  2. Android
  3. Using the SDK
  4. Trip Detection and Recording

Trip Manager Control

Enable Trip Detection and Recording

Trip detection and recording does not happen until you explicitly enable it at least once. Use the enableTripManager method to enable trip detection, recording, and trip file upload. Use the disableTripManager method to stop, such as when the user logs out.

Note that once ImsTripManager is enabled, it remains enabled even when the application restarts or the phone reboots. You only need to explicitly re-enable it if you previously disabled it.

When the trip manager is enabled it performs a comprehensive status check. Since some of the configuration is done in background, no status is returned from the enableTripManager method. Instead, you should monitor the status value in the trip status listener callback in case a user-addressable problem is detected. Typical problems are missing permissions (e.g. background location) or phone state (e.g. Bluetooth turned off).

// Enable Trip Detection using the current user's Identity
ImsTripManager.enableTripManager(context, currentIdentity);

Also, disableTripManager method is called, the SDK stops detecting any trip. This method has a boolean for deleting trip files. When true is passed in the method, the SDK will delete any trip files that are not uploaded yet, such as when user logs out.

//Disable Trip Detection but do not delete pending trip files
ImsTripManager.disableTripManager(context, deleteTripFiles)

Note that trip detection will only happen automatically if you specify at least one validator.

Programmatically Starting and Stopping Trips

The trip detection manager must be enabled before the trip recorder can be started or stopped programmatically (see previous section).

    ImsTripManager.startTrip(context, 0, null)
    // ...
    ImsTripManager.stopTrip(context, 0, null)

The start command has no effect if the recorder is already started (or if trip detection is disabled), and the stop command has no effect if the recorder's not already running.

  • If you have specified no validator (TripValidator.PHONE and/or TripValidator.DEVICE), then, once started, the trip recorder will continue recording indefinitely until you issue the stop command.

  • If you have specified at least one validator, trip recording will stop automatically using the validator, or when you issue the stop command, whichever comes first.

PreviousTrip Manager Device SupportNextTrip Manager Status

Last updated 2 months ago