Android SDK - Getting Started

Quick Start Guide

This guide will lead you through the first steps of integrating the Anyline Tire Tread SDK into your Android app.

You can check out our GitHub repository for a full example implementation of the Anyline Tire Tread SDK.

Add the Anyline Tire Tread SDK as dependency

The Anyline Tire Tread SDK for Android is available through the maven registry:

To integrate it, add the Anyline Tire Tread SDK io.anyline.tiretread.sdk:shared as a dependency to your build.gradle, along with the activity-compose dependency and the compose compiler options.

repositories {
    // ... your other repositories ...
    // Anyline Maven registry
    maven { url "" }

android {
    namespace 'your.apps.namespace'
    compileSdk 34

    defaultConfig {
        minSdk 26
        targetSdk 34

    buildFeatures {
        viewBinding true
        compose = true
    composeOptions {
        kotlinCompilerExtensionVersion = "1.5.4"

dependencies {
    // ... your other dependencies ...

    // Anyline Tire Tread SDK dependency
    // ideally, you should pin (at least) the Major version of the SDK to avoid unexpected breaking changes
    implementation 'io.anyline.tiretread.sdk:shared:3.+'

    // Include the 'Compose' dependency to be able to
    // integrate the TireTreadScanView in your Pages
    implementation 'androidx.activity:activity-compose:1.8.1'

    //... your other dependencies

The Anyline Tire Tread SDK follows the Semantic Versioning.

Integrate the Anyline License Key

A License Key string will be required in order to run the Anyline Tire Tread SDK on your app.

Store the License Key

You can integrate your license key string in a way that best suits your development workflow. You can add it to a strings.xml resource file; have it hard-coded into your Java/Kotlin file (not recommended, in most cases); securely fetch it from your back-end server or secret manager/provider; or request your appplication’s user to manually enter their License Key.

Initialize the Android Tire Tread SDK with the License Key

Initialize the Anyline Tire Tread SDK - and handle any exceptions thrown - before doing anything related to the SDK.

Here is an example on how to do it in Kotlin:

// This must be called before doing anything else with the AnylineTireTreadSdk.
// It only needs to be called once during your application life-cycle.
private fun initializeAnylineTireTreadSdk() : Boolean {

    val licenseKey = "<your-license-key>"

    // Try/Catch this to check if your license key is valid or not.
    try {
        AnylineTireTreadSdk.init(licenseKey, this)
        Log.i("Init SDK", "Success")
        return true
    } catch (e: SdkLicenseKeyInvalidException){
        Log.e("SettingsActivity", e.message, e)
    } catch (e: SdkInitializeFailedException){
        Log.e("SettingsActivity", e.message, e)
    return false
In the code above, replace <your-license-key> with your actual license key.

This function attempts to initialize AnylineTireTreadSdk with the provided license key. If the SDK fails to initialize, you should handle this error appropriately.

Add the necessary permissions and features

The TireTreadScanView requires the following permissions and features on your application:

  • Permissions

    • CAMERA



  • Features




Here is an example on how you can add them to your AndroidManifest.xml file:

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android=""

    <!-- declare camera, internet, and vibrate permission -->
    <uses-permission android:name="android.permission.CAMERA" />
    <uses-permission android:name="android.permission.INTERNET" />
    <uses-permission android:name="android.permission.VIBRATE" />

    <uses-feature android:name="" android:required="true" />
    <uses-feature android:name="" android:required="true" />
    <uses-feature android:name="" android:required="false" />

The Anyline Tire Tread SDK uses the camera for scanning the tires - your application must request the user’s permission to access the camera before using the TireTreadScanView. Please refer to the Official Android Documentation for more information about requesting runtime permissions, and/or check our example implementation on GitHub.

In the next section, you will learn how to integrate the TireTreadScanView to start scanning and measuring tires with your application.