LogoLogo
ProductsUse casesDocsSupport
  • Introducing DriveKit
  • DriveKit Guides
  • Get started with drivekit
    • Trip recording lifecycle
    • iOS
      • 🚀Quick start
      • Advanced configurations
      • References
      • iOS DriveKit Demo App
    • Android
      • 🚀Quick start
      • Advanced configurations
      • References
      • Android DriveKit Demo App
      • Android 15 Migration guide
      • Android 14 Migration guide
      • Troubleshooting
  • Trip analysis
    • Introduction
    • iOS
      • Permissions
      • Trip management
      • TripListener
      • Crash Detection
      • Beacon usage
      • Bluetooth usage
      • Custom metadata
      • References (iOS)
    • Android
      • Runtime permissions
      • Trip management
      • TripListener
      • Crash Detection
      • Beacon usage
      • Bluetooth usage
      • Custom metadata
      • References (Android)
    • User interface
      • iOS
        • Get started
        • Working hours
        • Driver alert in case of crash
        • Trip recording widget
        • Location sharing
      • Android
        • Get started
        • Working hours
        • Driver alert in case of crash
        • Trip recording widget
        • Location sharing
    • REST services
      • Trip
      • References
    • Trip Simulator
      • iOS
      • Android
  • PERMISSIONS UTILS
    • Introduction
    • User interface
      • iOS
        • Get started
        • Main configurations
      • Android
        • Get started
        • Main configurations
  • COMMON UI
    • Introduction
    • iOS
      • Get started
    • Android
      • Get started
    • References
  • DRIVER DATA
    • Introduction
    • iOS
      • Get started
      • References (iOS)
    • Android
      • Get started
      • References (Android)
    • User interface
      • iOS
        • Get started
        • Advanced configurations
        • Trips widgets
        • My Synthesis
        • My Driver Profile
      • Android
        • Get Started
        • Advanced configurations
        • Trips widgets
        • My Synthesis
        • My Driver Profile
  • Driver Data Timeline UI
    • Introduction
    • iOS
      • Get started
    • Android
      • Get started
  • Vehicle
    • Introduction
    • iOS
      • Get started
      • Vehicle management
      • Beacon management
      • Bluetooth device management
      • Odometer
      • References (iOS)
    • Android
      • Get started
      • Vehicle management
      • Beacon management
      • Bluetooth device management
      • Odometer
      • References (Android)
    • User interface
      • iOS
        • Get started
        • Main configurations
        • Advanced configurations
      • Android
        • Get started
        • Main configurations
        • Advanced configurations
  • DRIVER ACHIEVEMENT
    • Introduction
    • iOS
      • Get started
    • Android
      • Get Started
    • User interface
      • iOS
      • Android
  • CHALLENGE
    • Introduction
    • Important challenge rules
    • iOS
      • Get started
      • References (iOS)
    • Android
      • Get started
      • References (Android)
    • User interface
      • iOS
        • Get started
      • Android
        • Get started
  • GROUP
    • Introduction
    • iOS
      • Get started
    • Android
      • Get started
  • React Native
    • Get started
    • Integration
  • Flutter
    • Get started
    • Integration
  • Push services
    • Introduction
    • Push Trip Data
    • Push Deleted trip
    • Push Crash Data
    • Push Diagnosis Data
  • ADMIN SERVICES
    • Beacon
      • Add
      • Replace
      • Delete
      • Configuration
    • Challenges
      • List of challenges
      • Challenge details
      • Registered users
      • Challenge ranking
      • Users' progress
      • Definitions
    • Customer
      • Activity timeline
    • Driver
      • Timeline
      • Synthesis
      • Identity
      • Status
      • Add or update a metadata
      • Vehicles
      • Profile
      • Application diagnoses
    • Drivers
      • Account
      • Statistics
      • Ranking
      • Expired accounts
    • Group
      • Timeline
      • Synthesis
    • Trips
      • Add or update a metadata
      • Delete a metadata
    • Vehicle
      • Create
      • Characteristics
      • Configuration
      • Statistics
      • Update mileage
      • Tire and brake wear update
      • References
  • Crashes
    • Annotate a crash
    • Revoke crash location URL
  • ENTERPRISE SERVICES
    • Introduction
    • Teams
      • Create a team
      • List of teams
      • Enable or disable a team
    • Hyper-admins
      • Create a hyper-admin
      • List of hyper-admins
      • Delete a hyper-admin
    • Monitoring
      • Get a push trip data report
      • Get a push crash data report
      • Request to retry failed trips
      • Request to retry failed crashes
      • Get the status of a task
  • Release notes
    • Changelog
      • iOS
      • Android
      • UI iOS
      • UI Android
Powered by GitBook
On this page
  • Prerequisite
  • Integration
  • Get module from repository
  • Initialization
  • Synchronize list of challenges
  • Retrieve local challenge list
  • Synchronize challenge detail
  • Retrieve local challenge detail data
  • Join a challenge

Was this helpful?

Export as PDF
  1. CHALLENGE
  2. Android

Get started

PreviousAndroidNextReferences (Android)

Last updated 1 year ago

Was this helpful?

Prerequisite

Before starting DriveKit Challenge module integration, make sure that you have , especially if you have .

If you use DriveKit Challenge without having initialized DriveKit, an exception will be generated and the SDK will not work in your application.

Integration

Get module from repository

To add Challenge module to your app, add the following line to your dependencies in your application build.gradle file:

dependencies {
   implementation 'com.drivequant.drivekit:drivekit-challenge:$drivekit_version'
}

Replace $drivekit_version with the DriveKit version you are using in your app

Initialization

If you have , an initialization phase is required to use the functions offered by the Challenge component. To initialize Challenge component in your app, you must call the initialization method in onCreate method of your application class.

fun initialize()

Synchronize list of challenges

To synchronize the list of challenges, call the following method:

fun getChallenges(
   listener: ChallengesQueryListener,
   synchronizationType: SynchronizationType = DEFAULT
)

Retrieve local challenge list

You can retrieve the list of challenges stored in the DriveKit local database by calling the previous method but with the SynchronizationType parameter to CACHE.

Synchronize challenge detail

You need to call the following method if you want to get more details and statistics about a defined challenge:

fun getChallengeDetail(
    	challengeId: String,
    	listener: ChallengeDetailQueryListener,
    	synchronizationType: SynchronizationType = DEFAULT
)

This method have the following parameters:

Field
Type
Description

challengeId

String

Unique identifier of the challenge

synchronizationType

SynchronizationType

Can be DEFAULT or CACHE.

- DEFAULT will synchronize the challenge detail by calling the DriveQuant servers

- CACHE will retrieve the challenge detail already synchronized in the local database.

Retrieve local challenge detail data

You can retrieve the details of a given challenge stored in the DriveKit local database by calling the previous method but with the SynchronizationType parameter to CACHE.

Join a challenge

To be able to join a given challenge, you can call the following method:

fun joinChallenge(
    	challengeId: String,
    	listener: JoinChallengeQueryListener
)

This method have the following parameter:

Field
Type
Description

challengeId

String

Unique identifier of the challenge

and models are described in the References part.

Take a look at the of our DriveKit Demo App to see how it is implemented.

and models are described in the References part.

Take a look at the of our DriveKit Demo App to see how it is implemented.

enum values are described in the References part.

Take a look at the of our DriveKit Demo App to see how it is implemented.

open-source code
open-source code
open-source code
initialized DriveKit
ChallengesSyncStatus
Challenge
ChallengeDetailSyncStatus
ChallengeDetail
JoinChallengeSyncStatus
disable the SDK auto-initialization
disabled the SDK auto-initialization