Getting Started
Add the Anyline Tire Tread SDK as dependency
The Anyline Tire Tread SDK is available through Maven on Android and through Swift Package Manager or CocoaPods on iOS.
-
Android
-
iOS
The Anyline Tire Tread SDK for Android is available through the maven registry: https://europe-maven.pkg.dev/anyline-ttr-sdk/maven.
To integrate it, add the Anyline Tire Tread SDK io.anyline.tiretread.sdk:shared as a dependency to your build.gradle, along with the compose compiler options.
repositories {
// ... your other repositories ...
mavenCentral()
// Anyline Maven registry
maven { url "https://europe-maven.pkg.dev/anyline-ttr-sdk/maven" }
}
android {
namespace 'your.apps.namespace'
compileSdk 35
defaultConfig {
minSdk 23
targetSdk 35
...
}
buildFeatures {
viewBinding true
compose = true
}
composeOptions {
kotlinCompilerExtensionVersion = "1.5.12"
}
}
dependencies {
// Anyline Tire Tread SDK dependency
implementation 'io.anyline.tiretread.sdk:shared:15.0.0'
//... your other dependencies
}
The Anyline Tire Tread SDK for iOS is available via Swift Package Manager and CocoaPods.
Swift Package Manager
In Xcode, go to File → Swift Packages → Add Package Dependency and enter the framework’s repository URL: https://github.com/Anyline/anyline-tiretread-spm-module
After adding the dependency, import the framework into your native iOS application with the following line:
import AnylineTireTreadSdk
CocoaPods
⚠️ As announced in the Cocoapods Blog, Cocoapods will be discontinued at the end of 2026, making SPM the future-proof package manager for iOS applications.
Anyline continues to support Cocoapods, but we strongly recommend already consuming the Tire Tread SDK from SPM, as described above.
If you still wish to consume the SDK from Cocoapods, add the following line to your Podfile:
pod 'AnylineTireTreadSdk'
Run pod install in the terminal in the same directory as your Podfile.
|
The Anyline Tire Tread SDK follows Semantic Versioning. |
Integrate the Anyline License Key
A License Key string is required in order to run the Anyline Tire Tread SDK in your app.
Store the License Key
You can integrate your license key string in a way that best suits your development workflow.
As the integrator, you are responsible for managing your license key securely within your application. We strongly recommend using platform-specific secure storage solutions such as the Keychain for iOS and the Keystore for Android. Alternatively, consider implementing Dynamic Delivery to retrieve the license key at runtime from a secure server.
Initialize the Tire Tread SDK with the License Key
Call AnylineTireTread.initialize() once before doing anything related to the SDK. The callback returns an SdkResult, so you handle Ok when the SDK is ready and Err when initialization fails.
-
Android
-
iOS
import io.anyline.tiretread.sdk.api.AnylineTireTread
import io.anyline.tiretread.sdk.api.SdkResult
AnylineTireTread.initialize(context = applicationContext, licenseKey = "<YOUR_LICENSE_KEY>") { result ->
when (result) {
is SdkResult.Ok -> { /* SDK is ready */ }
is SdkResult.Err -> { /* Handle result.error */ }
}
}
import AnylineTireTreadSdk
AnylineTireTread.shared.initialize(licenseKey: "<YOUR_LICENSE_KEY>") { result in
if result.isOk {
// SDK is ready
} else if let error = result.error {
// Handle error
}
}
This function attempts to initialize AnylineTireTread with the provided license key. If the SDK fails to initialize, handle the returned SdkError appropriately.
|
Call |
After initialization, you can read the SDK version at any time via AnylineTireTread.sdkVersion (Android) or AnylineTireTread.shared.sdkVersion (iOS).
InitOptions
initialize() accepts an optional InitOptions parameter:
| Field | Type | Description |
|---|---|---|
|
|
A custom identifier to tell apart different devices of the same model. Sent to the backend with each measurement. |
|
|
Identifies the wrapper platform (Cordova, Flutter, ReactNative, etc.) and its version. Only needed when building your own wrapper layer around the native SDK. |
-
Android
-
iOS
AnylineTireTread.initialize(
context = applicationContext,
licenseKey = "<YOUR_LICENSE_KEY>",
options = InitOptions(customTag = "warehouse-device-04"),
) { result ->
when (result) {
is SdkResult.Ok -> { /* SDK is ready */ }
is SdkResult.Err -> { /* Handle result.error */ }
}
}
AnylineTireTread.shared.initialize(
licenseKey: "<YOUR_LICENSE_KEY>",
options: InitOptions(customTag: "warehouse-device-04")
) { result in
if result.isOk {
// SDK is ready
} else if let error = result.error {
// Handle error
}
}
Request the necessary permissions and features
Before starting the scan process, define the permissions required for the SDK to function correctly.
All permissions that require user interaction are handled in the SDK already. All that is left to do is add them:
-
Android
-
iOS
The Anyline Tire Tread SDK uses the camera for scanning the tires.
The Internet access permission is required at all times, whenever the SDK is called. To use the Haptic feedback, the Vibration permission should also be requested during compile time.
Here is the full list of permissions and features required by the Tire Tread SDK for Android:
-
Permissions
-
CAMERA -
INTERNET -
VIBRATE
-
-
Features
-
android.hardware.camera -
android.hardware.camera.flash -
android.hardware.camera.autofocus
-
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="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools">
<!-- 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.hardware.camera" android:required="true" />
<uses-feature android:name="android.hardware.camera.autofocus" android:required="true" />
<uses-feature android:name="android.hardware.camera.flash" android:required="false" />
...
</manifest>
Add a NSCameraUsageDescription entry to your Info.plist:
<key>NSCameraUsageDescription</key>
<string>Camera access is needed to scan tire tread depth.</string>
In the next section, you will learn how to present the scanner: