Telematics SDK | Developer portal
  • Get started
  • 4 Steps to Integrate SDK
  • Product Wiki
  • License
  • FAQ
  • PRODUCT DESCRIPTION
    • How it works
    • SDK Features
    • Scoring
      • Risk driving Scoring
        • Event detection
        • Trip rating
        • Overall scoring
      • Eco Scoring
    • Dataset
      • Dataset | User statistics API
      • Data samples
        • Summary - Processed track details (Rich track details)
        • Processed track waypoints (Rich track points)
        • Summary - list of Processed tracks
        • Incoming track events
        • Incoming track points (waypoints)
        • Summary - list of Incoming tracks
      • Dataset Decription
        • Bluetooth OBD - Vehicle Dataset
        • LastKnownPoints
        • IncomingTrackPoints
        • IncomingTrackEvents
        • Enriched telematics data
          • RichTracks
          • RichTrackPoints
          • RichTrackEvents
          • RichTrackDetails
          • UserStatisticDrivingDetails
        • Raw telematics data from SDK
    • Reporting
      • Drivecoins summary
      • Trip summary
      • Scoring summary
      • User state
      • Fraud
      • Trip waypoints
      • Trip events
    • External Articles
      • Why mobile telematics hits hardware telematics
  • Step 1: Create Datahub Account
  • Step 2: SDK Installation
    • Get started
    • iOS SDK installation
      • *Set up Your Development Environment
      • *Configure Your Project
      • *App Delegate
      • *Configure Framework
      • *React Native Installation
        • Create the iOS bridge
      • Add list of trips to your ViewController
      • Add statistics data to your ViewController
      • *What’s different in iOS 13?
      • *iOS 13 Permissions Wizard
      • *SDK Enable \ Disable \ Disable With Upload
      • *Incoming Tags
      • *Tracking Status
      • *SDK Delegates
      • *SDK Modes
      • *Using the Debugging Tools in Simulator
    • Android SDK installation
      • *Getting started
        • *Set up Your Development Environment
        • *Setup and enable SDK
        • *Permissions wizard
        • *Permissions dialog
        • *Configure SDK variables for notifications
      • *Subscribe to tracking events
      • *Incoming tags managing
      • *Migration from SDK v1.6.x to SDK v2.0.x
    • *Check SDK Installation
      • iOS Simulator
      • DataTool
      • ZenRoad
    • *Demo Applications
      • iOS | Open Source Demo Application
      • iOS | SDK Demo Application
      • iOS | Swift | SDK Demo Application
      • Android | SDK Demo Application
      • Android | Java | SDK Demo Application
      • Flutter | SDK Demo Application
    • SDK Changelog
      • Android SDK Changelog
      • iOS SDK Changelog
    • Permissions Guides
      • First Launch
        • iOS 13 (and higher) Permissions Guide
        • iOS 12 (and lower) Permissions Guide
        • Android 9 Permissions Guide
        • Android 9 XIaomi Permissions Guide
        • Android 10 Permissions Guide
      • *Troubleshooting
        • iOS — Troubleshooting
          • iOS — Troubleshooting
        • Android — Troubleshooting
          • Samsung — Troubleshooting
          • Oppo — Troubleshooting
          • Huawei — Troubleshooting
          • Xiaomi — Troubleshotting
          • OnePlus — Troubleshooting
          • Meizu — Troubleshooting
          • Asus — Troubleshooting
          • Vivo — Troubleshooting
          • Wiko — Troubleshooting
  • Step 3: Register SDK users
    • User Registration (API)
  • Step 4: API | User Statistics, Scores, Trips
    • Step 4: Get Statistics, Scorings and Trip Data
    • API Authorization
    • Statistics and Scoring APIs
      • Get started - Statistics and Scoring API
      • User | Individual Scorings and Statistics
      • Admin | User(s) - Scorings and Statistics
      • Admin | Consolidated Scorings and Statistics
    • Trips API
      • Get a short list of tracks
      • Get a list of tracks with paging
      • Get a list of tracks by IDs
      • Get a single track with waypoints
      • Get the most earliest track
      • Track Statuses
  • SDK Features
    • *Bluetooth Device - Get started
      • *Get Started
      • *Android - ELM API
      • *iOS - ELM API
    • Trip Tags - Get started
      • Tags for trips via mobile app
        • Android - Tags for trips
        • iOS - Tags for trips
      • Tags for period
      • Trip log by tags
  • PLATFORM FEATURES
    • *User Management
      • *User Registration
      • *Check User Existence
      • *User Management
    • *Vehicle Management
      • *Directories
      • *Vehicles
    • FNOL, Inspections & Damage Recognition
      • Get started
      • Profiles
      • Claims
      • Vehicle inspections
        • Dictionary of vehicle photos
      • Photo processing
    • *Leaderboard
      • *Summary Leaderboard
      • *Leaderboard by factors
      • Swagger - Leaderboard
    • *Streaks
    • *SNS
      • *How to register AWS SNS
    • 3rd party data processing
      • Swagger - Incoming getaway
    • *User & Permissions Status | Heartbeats
  • Other
    • Response Codes
    • Resources swaggers
      • Swagger: User service
      • Swagger: Scorings and Statistics API
      • Swagger: Telematics data
      • Swagger: Leaderboard
      • Swagger: Vehicle Management
      • Driving details
      • Swagger: FNOL, Inspections & Damage Recognition
      • Swagger: Heartbeats
    • Archive
      • Get started
      • Statistics and Scorings API
      • Step 5: Get statistics and trip data [ARCHIVED]
      • User Statistics API [Archived]
      • SDK - Statistics API [ARCHIVED]
        • Get the data to the Android app
          • Android Telematics data (Tracks)
            • Check current running track state
            • Get start date for current recording trip
            • Register tracking state listener (for onStartTracking/onStopTracking events)
            • Register speed violations listener
            • Get flag for registered speed violations listener
            • Get registered speed limit in km/h or default
            • Get registered speed violations timeout in ms or default
            • Get Tracks
            • Get detailed trips information
            • Get available user roles
            • Change a user role (any of TrackOriginDictionary.code)
          • Android User Statistics
            • Get Dashboard info
            • Get detailed Dashboard
            • Get Driving time statistics
            • Get Speeding statistics
            • Get Mileage statistics
            • Get Distracted Phone Usage statistics
        • Get the data to the iOS app
          • Other methods
          • iOS Telematics data (tracks)
            • Request all Tracks with specified offset and limit
            • Request all Tracks with specified offset and limit. No filter will be used in request
            • Request Track info with specified Track Token
            • Request Track origins dictionary
            • Change Track Origin Code
            • Share Track
          • iOS User Statistics
            • Get shared Track
            • Request main statistics data for all possible statistic types
            • NS_ENUM
            • Request main statistics data for all possible statistic types
            • Properties and Protocols
      • Get all DeviceTokens
    • Report a bug
    • Data Hub
    • Talk to sales
  • Postman collection
Powered by GitBook
On this page
  • Overview
  • Customizing
  • Location permission screen
  • Background location permission screen
  • Activity recognition permission screen (since Android 10)
  • Device location permission screen (when location services are switched off on the device)
  • Battery optimization permission screen
  • Custom power management tools disabling screen (custom feature for smartphones manufacturers like Samsung, Xiaomi, Huawei etc.)
  • Autostart enabling screen (custom feature for smartphones manufacturers like Xiaomi, Huawei etc.)
  • Notifications showing permissions screen (custom feature for smartphones manufacturers)
  • Additional resources
  • Common text customizations
  • Customizing image-resources
  • Customizing colors
  • Customizing dimens

Was this helpful?

  1. Step 2: SDK Installation
  2. Android SDK installation
  3. *Getting started

*Permissions wizard

Since 2.2.225 version we don't need access to phone's local storage and implemented more comfortable way to customize our Permissions wizard.

Previous*Setup and enable SDKNext*Permissions dialog

Last updated 4 years ago

Was this helpful?

Overview

Wizard is user-friendly activity with step-by-step description of each required permissions and Proceed button to request them. For example, wizard will look like this on Android 10:

To start wizard from your activity or fragment use code below:

startActivityForResult(
       PermissionsWizardActivity
               .getStartWizardIntent(
                       context = this,
                       enableAggressivePermissionsWizard  = false,
                       enableAggressivePermissionsWizardPage  = false
               ),
       PermissionsWizardActivity.WIZARD_PERMISSIONS_CODE
)

Where enableAggressivePermissionsWizard flag you set to true when wizard will be finished if all required permissions granted (user can’t cancel it with back button), and false if wizard can be finished with not all granted permissions or cancelled with back button.

Where enableAggressivePermissionsWizardPage flag you set to true when wizard will slide to next page if requested permissions granted on current page, and false if wizard can slide with not granted permissions.

See table below to see how it works:

enabled Aggressive Permissions Wizard

enabled Aggressive Permissions WizardPage

cancelable wizard

can deny requested pemission and slide to next step

can finish wizard without all granted perms

true

true

no

no

no

true

false

no

yes

no

false

true

yes

no

no

false

false

yes

yes

yes

And after that you can get the result in onActvityResult method by this way:

override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) {
   super.onActivityResult(requestCode, resultCode, data) 
   // don’t forget to call here and in all base activity/fragments
   if (requestCode == PermissionsWizardActivity.WIZARD_PERMISSIONS_CODE) {
       when (resultCode) {
           WIZARD_RESULT_ALL_GRANTED -> {
               /* when user finished wizard with all required permissions
granted - enable SDK if Device ID is exist*/
               enableSDK()
           }
           WIZARD_RESULT_CANCELED -> {
               // when user canceled wizard
               Toast.makeText(this, "Wizard canceled!",
Toast.LENGTH_SHORT).show()
           }
           WIZARD_RESULT_NOT_ALL_GRANTED -> {
               /* when user finished wizard with not all required permissions
granted*/
               Toast.makeText(this, "NOT All Required Permissions Granted!",
Toast.LENGTH_SHORT).show()
           }
       }
   }
}

Customizing

The permission wizard can be different. But generally there could be 8 screens:

Location permission screen

Location restrictions on Android were chaged twice in 10 and 11 versions.

If you want to customize description of this screen you should override resources:

values/strings.xml

    <!-- Generic location permission description -->
    <string name="wizard_telematics_location_desc">As the next step, you will receive a popup to grant rights to access to <b>location</b>.\n\n
        We use location service for evaluating your driving manner.\nBy enabling <b>Allow</b> on location, application will be able to automatically determine when you have started and ended a drive.
    </string>

    <!-- Bottom dialog before the app name text-->
    <string name="wizard_telematics_attention_dialog_location_before">Allow</string>
    
    <!-- Bottom dialog after the app name text -->
    <string name="wizard_telematics_attention_dialog_location_after">to\naccess this device\'s location?</string>

values-v29/strings.xml

<!-- Android 10 location permission description -->
<string name="wizard_telematics_location_desc">As the next step, you will receive a popup to grant rights to access to <b>location</b>.\n\n
    We use location service for evaluating your driving manner.\nBy enabling <b>Allow all the time</b> on location, application will be able to automatically determine when you have started and ended a drive.
</string>
<!-- Bottom dialog after the app name text-->
<string name="wizard_telematics_attention_dialog_location_after">to access this device\'s location?</string>

values-v30/strings.xml

<!-- Android 11 location permission description -->
<string name="wizard_telematics_location_desc">As the next step, you’ll see a popup to grant app access to <b>location services</b>.\n\n
        The app uses your location data to automatically record your trips in background, determine when you have started and ended your trip and to measure your score.\n\n
        The app will not work without this permission.\n\n
        On the next popup, please select <b>While using the app</b>.
</string>

Background location permission screen

Since Android 11 Google introduced new privacy feature releated to location permission granting. Now if application needs access to users location in the background it should first grant access to foreground location and only after that it can ask permission to access locaition in the background.

values/strings.xml

<!-- background location permission description -->
<string name="wizard_telematics_background_location_desc">
        As the next step, you should grant rights to access to <b>location in background.</b>\n\n
        The app will not work without this permission.\n\n
        You should navigate to app settings and choose "<b>Allow all the time</b> on the Location permission screen.</string>
    
<!-- Additional text in the bottom dialog -->
<string name="wizard_telematics_location_additional_description">This app may want to access your location all the time, even when you\'re not using the app. <font color="#a7c7f9"><u>Allow in settings.</u></font></string>

<!-- Dialog text before app name -->        
<string name="wizard_telematics_attention_dialog_background_location_before">Change location access for </string>

<!-- Dialog text after app name -->      
<string name="wizard_telematics_attention_dialog_background_location_after">\?</string>

<!-- Dialog text to keep permission in "While using the app" -->  
<string name="wizard_telematics_location_additional_keep">Keep \'While using the app\'</string>  

Activity recognition permission screen (since Android 10)

values/strings.xml

<!-- Wizard activity recognition section -->
<string name="wizard_telematics_activity_recognition_desc">Then, you will receive a popup to grant access to your <b>physical activity</b>. \nWe need this information to create a driving score.\n\n
    Please, choose <b>Allow</b> for application to grant access to physical activity.
</string>
<!-- Bottom dialog before the app name text-->
<string name="wizard_telematics_attention_dialog_activity_recognition_before">Allow</string>
<!-- Bottom dialog after the app name text-->
<string name="wizard_telematics_attention_dialog_activity_recognition_after">to\naccess your physical activity?</string>

values-v29/strings.xml

<!-- Bottom dialog after the app name text-->
<string name="wizard_telematics_attention_dialog_activity_recognition_after">to access your physical activity?</string>

Device location permission screen (when location services are switched off on the device)

values/strings.xml

<!-- Gps services description -->
<string name="wizard_telematics_gps_google_desc">You will receive a popup shortly to turn on <b>device location</b>, which uses Google\'s location service.\n\n
    For the app to work properly choose <b>OK</b>
</string>
<string name="wizard_telematics_attention_dialog_gps_google">For a better experience, turn on device location, which uses Google\'s location service.</string>
<string name="dialog_telematics_attention_dialog_gps_google_ok">OK</string>
<string name="dialog_telematics_attention_dialog_gps_google_no">No, thanks</string>

Battery optimization permission screen

values/strings.xml

<string name="wizard_telematics_ignore_system_battery_optimization_desc">You will receive a popup shortly to ignore <b>battery optimizations</b>.\n\n
    For the app to work properly choose <b>ALLOW</b>
</string>
<string name="wizard_telematics_attention_dialog_battery">Let app always run in background?\n\nAllowing application to always run in the\nbackground may reduce battery life.\n\nYou can change this later from\nSettings > Apps &amp; notifications.</string>
<string name="dialog_telematics_attention_dialog_battery_ok">ALLOW</string>
<string name="dialog_telematics_attention_dialog_battery_no">DENY</string>

Custom power management tools disabling screen (custom feature for smartphones manufacturers like Samsung, Xiaomi, Huawei etc.)

values/strings.xml

<string name="wizard_telematics_extra_power_management_desc">By press "Proceed" you will be forwarded to settings to setup <b>power management</b>.\n
For the app to work properly <b>DISABLE</b> power management.
</string>

Autostart enabling screen (custom feature for smartphones manufacturers like Xiaomi, Huawei etc.)

values/strings.xml

<string name="wizard_telematics_extra_autostart_desc">By press "Proceed" you will be forwarded to settings to setup <b>AUTOSTART</b>.\n
    For the app to work properly <b>ENABLE</b> autostart</string>

Notifications showing permissions screen (custom feature for smartphones manufacturers)

values/strings.xml

<string name="wizard_telematics_extra_notifications_desc">By press "Proceed" you will be forwarded to settings to setup <b>notifications</b>.\n
For the app to work properly <b>ENABLE</b> all notification.</string>

Additional resources

values/strings.xml

<!-- Bottom proceed button resource -->
<string name="wizard_telematics_show_request">Proceed</string>
<!-- Allow button resource -->
<string name="wizard_telematics_deny">Deny</string>
<!-- Deny button resource -->
<string name="wizard_telematics_allow">Allow</string>
<!-- Allow all the time resource -->
<string name="wizard_telematics_allow_all_time">Allow all the time</string>
<!-- Allow only while using the app resource -->
<string name="wizard_telematics_allow_while_using">Allow only while using the app</string>
<!-- Steps resource in the top of wizard. !Important! FORMAT SHOULD BE THE SAME! -->
<string name="wizard_telematics_step">STEP %1s of %2s</string>

<string name="wizard_telematics_please_grant">Please, grant all required permissions</string>

<!-- Android 11 new resoucres-->
<string name="wizard_telematics_while_using_11">While using the app</string>
<string name="wizard_telematics_only_this_time">Only this time</string>
<string name="wizard_telematics_ask_every_time">Ask every time</string>

Common text customizations

Customizing font:

  1. Specify annotation for the text with name font

Sample:

Add custom support library font

digital_font.xml

<?xml version="1.0" encoding="utf-8"?>
<font-family xmlns:app="http://schemas.android.com/apk/res-auto">
    <font app:font="@font/digital" />
</font-family>

Add the <annotation> tag, and define the key-value pair. In this case, the key is font, and the value is the font-resource name

<string name="wizard_telematics_gps_google_desc">You will receive a popup shortly to turn on <b>device location</b>, which uses <annotation font="digital">Google\'s</annotation> location service.\n\n
    For the app to work properly choose <b>OK</b>
</string>

Customizing size of the text

  1. Add dimen resource of the

  2. Specify annotation for the text with name textSize

Sample

Dimen-resource:

<dimen name="text_size">12sp</dimen>

Add the <annotation> tag, and define the key-value pair. In this case, the key is textSize, and the value is the dimen-resource name

<string name="wizard_telematics_gps_google_desc">You will receive a popup shortly to turn on <b>device location</b>, which uses <annotation font="digital" textSize="text_size">Google\'s</annotation> location service.\n\n
    For the app to work properly choose <b>OK</b>
</string>

Customizing image-resources

If you dont want to use our bottom dialog view you can replace it with your own drawable-resource:

Specify drawable resource with the name:

// location permission screen image
ic_wizard_image_location

// background location permission screen image
ic_wizard_image_location_background

// activity recognition permission screen image
ic_wizard_image_activity_recognition

// device location screen image
ic_wizard_image_gps_sensor

// battery optimization permission screen image
ic_wizard_image_battery_optimization

// huawei autostart permission screen image
ic_wizard_autostart_huawei

// xiaomi autostart permission screen image
ic_wizard_autostart_xiaomi

// default autostart permission screen image
ic_wizard_autostart_default

// notifications showing permission screen image
ic_wizard_notifications_default

Customizing colors

values\colors.xml

<!-- Wizard -->
<color name="colorTelematicsWizardBackground">#FAFAFA</color>
<color name="colorTelematicsWizardPrimaryText">#494949</color>
<color name="colorTelematicsWizardSecondaryText">#80464646</color>
<color name="colorTelematicsWizardButtonText">#fff</color>
<color name="colorTelematicsWizardButtonNorm">#80464646</color>
<color name="colorTelematicsWizardButtonPressed">#464646</color>
<!-- Alert dialog inside wizard - common colors -->
<color name="colorTelematicsDialogAlertBackground">#fff</color>
<color name="colorTelematicsDialogAlertButtonActiveBg">#ff8400</color>
<color name="colorTelematicsDialogAlertText">#80464646</color>
<color name="colorTelematicsDialogAlertButtonActiveText">#fff</color>
<!-- Alert dialog inside wizard for Android =< 9 -->
<color name="colorTelematicsDialogAlertInactiveText">#009687</color>
<!-- Alert dialog inside wizard for Android >= 10 -->
<color name="colorTelematicsDialogAlertInactiveTextQ">#a7c7f9</color>

Customizing dimens

values\dimens.xml values-xhdpi\dimens.xml values-xxhdpi\dimens.xml

<!-- Overrided DialogFragment SDK resources -->
<dimen name="dialog_telematics_view_bubble_corners">20dp</dimen>
<dimen name="dialog_telematics_button_corners">35dp</dimen>
<!-- Overrided Wizard SDK resources -->
<dimen name="wizard_telematics_button_corners">5dp</dimen>

All resources which are used are supporting . But also you can set custom font and font the text (or to the part of the text) via

Specify your font in resources (check )

Html-markup styling
annotations
documentation