> ## Documentation Index
> Fetch the complete documentation index at: https://guide.daro.so/llms.txt
> Use this file to discover all available pages before exploring further.

# Getting Started

> Integrate the DARO Android SDK into your app.

export const androidPlguinLatestVersion = '2.0.0';

export const androidDaroSdkLatestVersion = '2.0.1';

<Note>
  An Ad Unit defines an ad placement and format in your app. For the DARO 2.0.1 SDK, copy the **Ad Unit Key** from the updated dashboard. This is different from the app’s Integration Key. API parameters such as `adUnitId`, `unitId`, and `key`, and example placeholders such as `YOUR_AD_UNIT_ID`, keep their names but take that Ad Unit’s Ad Unit Key. Existing integrations using Ad Unit IDs remain supported. Do not confuse reporting or callback identifiers with the key for a new integration.
</Note>

## Before You Begin

Check requirements before integration.

### Requirements

* Android minSdkVersion: 23

<Check>
  Verify [app-ads.txt setup](https://guide.daro.so/en/app-ads-txt-settings) before proceeding.
</Check>

<Warning>
  **Desugaring required**: Configure desugaring if minSdk is below 26.

  <CodeGroup>
    ```kotlin kotlin {4,5,6,7,8,18} theme={null}
    android {
        ...

        compileOptions {
            isCoreLibraryDesugaringEnabled = true
            sourceCompatibility = JavaVersion.VERSION_1_8
            targetCompatibility = JavaVersion.VERSION_1_8
        }

        ...
    }

    ...

    dependencies {
        ...

        coreLibraryDesugaring("com.android.tools:desugar_jdk_libs:2.0.4")

        ...
    }
    ```

    ```groovy groovy {4,5,6,7,8,18} theme={null}
    android {
        ...

        compileOptions {
            coreLibraryDesugaringEnabled true
            sourceCompatibility JavaVersion.VERSION_1_8
            targetCompatibility JavaVersion.VERSION_1_8
        }

        ...
    }

    ...

    dependencies {
        ...

        coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:2.0.4'

        ...
    }
    ```
  </CodeGroup>
</Warning>

***

## Upgrading From an Earlier Version

Follow the [Android migration guide](/en/sdk-integration-v2/android/migration-guide) to update the dashboard and remove legacy key files and app key settings first. Then integrate the DARO 2.0.1 SDK in the order below.

***

## Configure Your App

<Steps>
  <Step title="Project-level build configuration">
    * Add the repositories below to `settings.gradle.kts` (Kotlin DSL) or `settings.gradle` (Groovy DSL) in the project root.
    * If `dependencyResolutionManagement` already exists, add the repositories to its `repositories` block.

    <CodeGroup>
      ```kotlin settings.gradle.kts theme={null}
      dependencyResolutionManagement {
          repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
          repositories {
              google()
              mavenCentral()
              maven { url = uri("https://artifact.bytedance.com/repository/pangle") }
              maven { url = uri("https://android-sdk.is.com/") }
              maven { url = uri("https://dl-maven-android.mintegral.com/repository/mbridge_android_sdk_oversea") }
              maven { url = uri("https://repo.pubmatic.com/artifactory/public-repos") }
              maven { url = uri("https://maven.ogury.co") }
          }
      }
      ```

      ```groovy settings.gradle theme={null}
      dependencyResolutionManagement {
          repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
          repositories {
              google()
              mavenCentral()
              maven { url 'https://artifact.bytedance.com/repository/pangle' }
              maven { url 'https://android-sdk.is.com/' }
              maven { url 'https://dl-maven-android.mintegral.com/repository/mbridge_android_sdk_oversea' }
              maven { url 'https://repo.pubmatic.com/artifactory/public-repos' }
              maven { url 'https://maven.ogury.co' }
          }
      }
      ```
    </CodeGroup>
  </Step>

  <Step title="Add the DARO plugin to build.gradle(root)">
    Add the DARO plugin to your `build.gradle(root)` file.

    <Info>
      Latest version

      * daro-plugin : {androidPlguinLatestVersion}
    </Info>

    <CodeGroup>
      ```kotlin kotlin theme={null}
      buildscript {
          repositories {
              google()
              mavenCentral()
              maven { url = uri("https://artifacts.applovin.com/android") }
          }
          dependencies {
              classpath("so.daro:daro-plugin:2.0.0")
          }
      }
      ```

      ```groovy groovy theme={null}
      buildscript {
          repositories {
              google()
              mavenCentral()
              maven { url 'https://artifacts.applovin.com/android' }
          }
          dependencies {
              classpath 'so.daro:daro-plugin:2.0.0'
          }
      }
      ```
    </CodeGroup>
  </Step>

  <Step title="Apply the DARO plugin to build.gradle(app)">
    Apply the DARO plugin in `build.gradle(app)`.

    <CodeGroup>
      ```kotlin kotlin theme={null}
      plugins {
          ...
          id("so.daro")
          ...
      }
      ```

      ```groovy groovy theme={null}
      plugins {
          ...
          id 'so.daro'
          ...
      }
      ```
    </CodeGroup>
  </Step>

  <Step title="Declare DARO_INTEGRATION_KEY in AndroidManifest.xml">
    Declare the Integration Key inside `<application>` in your app module's `src/main/AndroidManifest.xml`.

    ```xml theme={null}
    <application
        ...>

        <meta-data
            android:name="DARO_INTEGRATION_KEY"
            android:value="YOUR_INTEGRATION_KEY" />

        ...
    </application>
    ```

    <Note>
      The Integration Key is issued per app and can be obtained from the DARO dashboard.
    </Note>

    <Note>
      This example uses the same dashboard app for every build variant. Enter that app’s Integration Key as a literal value in the app module’s `src/main/AndroidManifest.xml`. When setting `DARO_INTEGRATION_KEY` in the manifest, enter the actual key value instead of a `${...}` placeholder.
    </Note>
  </Step>

  <Step title="Update app-ads.txt">
    Follow the [app-ads.txt guide](/en/app-ads-txt-settings) and publish the latest content provided by the dashboard.
  </Step>

  <Step title="Add DARO SDK">
    Add the DARO SDK.

    <Info>
      Latest version

      * daro-sdk : {androidDaroSdkLatestVersion}
    </Info>

    <CodeGroup>
      ```kotlin kotlin theme={null}
      dependencies {
          ...
          implementation("so.daro:daro-sdk:2.0.1")
          ...
      }
      ```

      ```groovy groovy theme={null}
      dependencies {
          ...
          implementation 'so.daro:daro-sdk:2.0.1'
          ...
      }
      ```
    </CodeGroup>

    <Note>
      * `daro-sdk` provides Compose components, including `DaroBanner` and `DaroNative`, in the `droom.daro.compose` package.
      * For a new integration, use these components without a separate `daro-compose-util` dependency. Your app needs Compose runtime 1.7.0 or later.
      * If you previously used `so.daro:daro-compose-util`, remove that dependency and use the Compose components provided by `daro-sdk`. You can keep your existing imports.
    </Note>
  </Step>
</Steps>

<Note>
  The SDK includes consumer obfuscation rules that Gradle applies automatically. You do not need to copy them into your project.
</Note>

## Initialize SDK

<Warning>
  **Important: Load Ads After Initialization**

  * Initialize DARO SDK before loading ads by calling `Daro.init()`.
  * Requesting ads before initialization may prevent proper display.
</Warning>

```kotlin theme={null}
import android.app.Application
import droom.daro.SDKConfig
import droom.daro.sdk.Daro

class AppApplication : Application() {

  override fun onCreate() {
    super.onCreate()

    // Daro SDK initialization
    Daro.init(
      application = this,
      sdkConfig = SDKConfig.Builder()
          .setDebugMode(false) // (debug mode, default : false — must be false in production builds)
          .setAppMuted(false) // (set app mute, default : false)
          .build()
    )
  }
}
```

<Warning>
  `setDebugMode(true)` is for test builds only. Always set it to `false` in production builds.
</Warning>

## App Mute Setting

For app open, banner, interstitial, rewarded, rewarded interstitial, and native ad formats, you can use the `setAppMuted(...)` method to inform the DARO SDK that the app volume has been muted.

```kotlin theme={null}
// Mute app
Daro.setAppMuted(true)


// Unmute app
Daro.setAppMuted(false)
```

<Tip>
  Native ads apply the mute state to video playback at load time, so call `setAppMuted` before loading native ads.
</Tip>

<Warning>
  **App Mute Usage Precautions**

  When app mute is enabled, some video ad creatives that cannot play while muted may be excluded from ad requests, which can slightly reduce the ad pool and affect revenue.
</Warning>
