> For the complete documentation index, see [llms.txt](https://platform-business.gitbook.io/adx/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://platform-business.gitbook.io/adx/zh/android/integrate.md). Agents can also search and read this documentation through its [MCP server](https://platform-business.gitbook.io/adx/~gitbook/mcp).

# Integrate

## 0. 最新 ADX Android SDK 版本

{% hint style="success" %}
Version 2.9.2

Release Date : 2026/10/21
{% endhint %}

## 1. 最低支持配置

{% hint style="info" %}

* minSdkVersion **24** 或更高版本
* compileSdkVersion 35 或更高版本
  {% endhint %}

## 2. 添加 ADX Android SDK

{% hint style="info" %}
根据 ADX Android SDK 的更新情况以下内容可能会更改
{% endhint %}

1\) 项目层 `build.gradle` 文件中 `allprojects` 部分添加以下Repository。

```typescript
allprojects {
    repositories {
        // ... other project repositories
        google()
        mavenCentral()
        maven { url 'https://jitpack.io' }
    }
}
```

2\) 模块层 `build.gradle` 文件中 `dependencies` 部分添加以下Dependency。

```typescript
dependencies {
    // 如果包含整个库
    implementation 'com.github.adxcorp.ADXLibrary_Android:adx-library:2.9.2'

    // 仅包含原生（Native）的情况下
    implementation 'com.github.adxcorp.ADXLibrary_Android:adx-library-native:2.9.2'

    // 仅包含插页/横幅的情况下
    implementation 'com.github.adxcorp.ADXLibrary_Android:adx-library-standard:2.9.2'

    // 仅包含激励视频的情况下
    implementation 'com.github.adxcorp.ADXLibrary_Android:adx-library-rewarded-video:2.9.2'

    // 例如要包含插页/横幅/原生，可按如下添加
    implementation 'com.github.adxcorp.ADXLibrary_Android:adx-library-standard:2.9.2'
    implementation 'com.github.adxcorp.ADXLibrary_Android:adx-library-native:2.9.2'

    // 使用 Google Play 服务 Ads 25.4.0 版本
    implementation 'com.google.android.gms:play-services-ads:25.4.0'
}
```

## 3. Project Setting

* 若要支持 Java 8 语言特性，请在模块的 `build.gradle` 文件中 `android` 部分中 添加 `compileOptions`。

```typescript
android {
    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }
}
```

## 4. AdMob APP ID 设置

* `AndroidManifest.xml` 文件中 `<meta-data>` 标签中 `添加 "com.google.android.gms.ads.APPLICATIONID"`和已发放的 AdMob APP ID。

{% hint style="danger" %}
若不添加`<meta-data>` 标签，会显示以下信息并导致应用异常退出。`The Google Mobile Ads SDK was initialized incorrectly.`
{% endhint %}

```typescript
    <application>
        <meta-data
            android:name="com.google.android.gms.ads.APPLICATION_ID"
            android:value="YOUR_ADMOB_APP_ID"/>
    </application>
</manifest>
```
