2. Install the Airflux SDK
1. SDK Installation
1
Declare the SDK Repository
dependencyResolutionManagement {
repositories {
maven { url = "https://sdk-download.airflux.ai/maven" }
}
}dependencyResolutionManagement {
repositories {
maven { url = uri("https://sdk-download.airflux.ai/maven") }
}
}allprojects {
repositories {
maven { url = "https://sdk-download.airflux.ai/maven" }
}
}allprojects {
repositories {
maven { url = uri("https://sdk-download.airflux.ai/maven") }
}
}2
Add the SDK Package
dependencies {
// Replace $HERE_LATEST_VERSION with the latest version from the SDK Versions page.
implementation "ai.airflux:sdk-android:$HERE_LATEST_VERSION"
}dependencies {
// Replace $HERE_LATEST_VERSION with the latest version from the SDK Versions page.
implementation("ai.airflux:sdk-android:$HERE_LATEST_VERSION")
}2. SDK Initialization
2
Initialize the SDK
SDK Option
Method
Data Type
Description
Required
import ai.airflux.Airflux
import ai.airflux.AirfluxOptionBuilder
import ai.airflux.AirfluxLogLevel
import android.app.Application
class MainApplication : Application() {
override fun onCreate() {
super.onCreate()
// Creates the option for initializing the Airflux SDK.
// Replace "YOUR_APP_NAME" and "YOUR_APP_TOKEN" with your actual credentials.
val option = AirfluxOptionBuilder("YOUR_APP_NAME", "YOUR_APP_TOKEN")
// Automatically enables the SDK on startup.
.setSDKEnabled(true)
// Automatically starts tracking events.
.setAutoStartTrackingEnabled(true)
// Sets the log level to debug for detailed logs.
.setLogLevel(AirfluxLogLevel.DEBUG)
// Sets the session timeout to 300 seconds (5 minutes).
.setSessionTimeout(300)
// Allows Airflux features in all countries.
.setAllowEveryCountryEnabled(true)
// Uncomment the line below to allow only specific countries.
// .setCountryAllowlist(listOf("US", "KR", "JP"))
.build()
Airflux.initializeSDK(this, option)
}
}3. Verification
Android Logcat check
4. Frequently Asked Questions
5. Troubleshooting
Last updated

