Initialization and configuration

Introduction

Documentation is provided using Kotlin language. You can find demo sample app here

Initialization

The library is initialized with license key and user unique identification (user_id). Optionally configuration, user country, and vehicle settings can be set.

val configuration = Configuration.Builder()
    .drivingServerUrl(customDrivingServerUrl)
    .sendOnMobileData(true)
    .tripValidityCriteria(TripValidityCriteria(
            minimalTripDurationSeconds = minDuration,
            minimalTripLengthMeters = minLength
        ))
    .localTripsPolicy(LocalTripsPolicy.Enabled)
    .build()

val vehicleSettings = VehicleSettings.Builder()
    .vehicleType(VehicleType.Car)
    .maxSpeedKph(130)
    .build()

val initializer = Driving.Initializer(
        context = context,
        clientId = Constants.DRIVING_CLIENT_ID,
        userId = userId,
        license = SygicLicense.KeyString(Constants.SYGIC_LICENSE),
        configuration = configuration,
        vehicleSettings = vehicleSettings,
        notificationProvider = notificationProvider,
        allowNoGyroMode = true,
        sygicAuth = SygicAuthConfig.Default(
            authUrl = Constants.AUTH_URL)
    )