Skip to main content

Requirements

Before integrating the AppDNA Android SDK, ensure your project meets the following minimum requirements:
RequirementMinimum Version
minSdk24
targetSdk34
compileSdk34
Kotlin1.9.22+
Java17
Projects targeting API levels below 24 (Android 7.0) are not supported. The SDK uses Kotlin coroutines and modern Android APIs that require minSdk 24 as a baseline.

Installation

Gradle (Kotlin DSL)

Add the AppDNA SDK to your module-level build.gradle.kts:
dependencies {
    implementation("ai.appdna:sdk:1.0.30")
}

Gradle (Groovy DSL)

If your project uses Groovy-based Gradle files, add the following to your build.gradle:
dependencies {
    implementation 'ai.appdna:sdk:1.0.30'
}
Then sync your project with Gradle files.

Firebase Configuration

The AppDNA SDK uses Firebase Firestore for real-time configuration delivery (paywalls, experiments, feature flags, onboarding flows) and Firebase Cloud Messaging for push notifications. You must add a Firebase configuration file to your project.

Step 1: Download google-services-appdna.json

  1. Log into your AppDNA Console
  2. Go to Settings → SDK
  3. Click Download Firebase Config to download google-services-appdna.json

Step 2: Add to Your Project

Place the google-services-appdna.json file in your app module directory:
your-project/
  app/
    google-services-appdna.json    <-- place here
    build.gradle.kts
    src/

Step 3: Apply the Google Services Plugin

Add the Google Services classpath to your project-level build.gradle (or build.gradle.kts):
// build.gradle (project-level)
buildscript {
    dependencies {
        classpath 'com.google.gms:google-services:4.4.0'
    }
}
Then apply the plugin in your app-level build.gradle (or build.gradle.kts):
// app/build.gradle
apply plugin: 'com.google.gms.google-services'
Or with Kotlin DSL:
// app/build.gradle.kts
plugins {
    id("com.google.gms.google-services")
}
Without google-services-appdna.json, the SDK cannot fetch remote configuration (paywalls, experiments, feature flags) or receive push notifications. Events will still be tracked, but remote features will not work.
If your app already uses Firebase for your own services (Analytics, Crashlytics, Realtime Database), AppDNA automatically creates a separate named Firebase instance using google-services-appdna.json. Your existing Firebase setup is not affected. Just add the AppDNA config file alongside your own google-services.json.

Dependencies

The following dependencies are automatically included with the SDK. You do not need to add them manually:
DependencyVersionPurpose
Firebase Firestore25.1.1Real-time remote configuration sync
Firebase Messaging24.1.0Push notification delivery (FCM)
OkHttp34.12.0HTTP networking
Google Play Billing7.0.0In-app purchase and subscription handling
Kotlin Coroutines1.7.3Asynchronous operations
Lottie Compose6.4.0Lottie animation rendering
Rive Android9.0.0Rive animation rendering
WorkManager2.9.0Background event upload
If your project already includes these dependencies, ensure your version constraints are compatible with the versions listed above. Gradle will resolve version conflicts automatically in most cases, but you may need to add resolution strategies for major version mismatches.

Optional Dependencies

DependencyVersionInclusionPurpose
RevenueCat SDK7.0.0compileOnlyRevenueCat billing provider
RevenueCat is declared as compileOnly and is only required if you configure RevenueCat as your billing provider. If you do not use RevenueCat, you do not need to add it.

Jetpack Compose

The SDK uses Jetpack Compose for rendering paywalls and onboarding flows. Compose is enabled automatically using BOM 2024.01.00. Ensure your project has Compose enabled in your module-level build.gradle.kts:
android {
    buildFeatures {
        compose = true
    }
    composeOptions {
        kotlinCompilerExtensionVersion = "1.5.8"
    }
}

Verify Installation

After adding the SDK, verify it is correctly installed by importing the module and logging the SDK version:
import ai.appdna.sdk.AppDNA
import android.util.Log

Log.d("AppDNA", AppDNA.sdkVersion) // "1.0.30"
You should see 1.0.30 printed in Logcat. If you get an unresolved reference error, clean your project (Build > Clean Project) and rebuild.

Next Steps

Once the SDK is installed, proceed to the Quickstart guide to configure the SDK and start tracking events.