广告聚合

Get Started with Android

Before You Begin 🔗

Minimum Supported Development Tools 🔗

Software Version
Android Studio 2020.3.1+
Android OS 5.0+ (API level 33)
Gradle 7.6
Kotlin 1.7.20

Add the Mediation SDK to Your Project 🔗

For build.gradle

repositories {
  maven {
    name "Chartboost Mediation’s maven repo"
    url "https://cboost.jfrog.io/artifactory/chartboost-mediation"
  }
}
 
dependencies {
   implementation 'com.chartboost:chartboost-mediation-sdk:4.9.1'
}

Add 3rd-Party Dependencies 🔗

implementation 'com.jakewharton.retrofit:retrofit2-kotlinx-serialization-converter:1.0.0'
implementation 'com.squareup.okhttp3:logging-interceptor:4.10.0'
implementation 'com.squareup.okhttp3:okhttp:4.10.0'
implementation 'com.squareup.retrofit2:converter-scalars:2.9.0'
implementation 'com.squareup.retrofit2:retrofit:2.9.0'
implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-android:1.7.1'
implementation 'org.jetbrains.kotlinx:kotlinx-serialization-json:1.5.1'

Add Google Play Services 🔗

Add the Google Play Services Library as a dependency of your project. For detailed instructions, reference the official integration instructions for Google Play Services.

Instead of referencing the entire Google Play Services package, you only need play-services-base, play-services-ads-identifier, and play-services-appset:

implementation 'com.google.android.gms:play-services-base:18.0.1'
implementation 'com.google.android.gms:play-services-ads-identifier:18.0.1'
implementation 'com.google.android.gms:play-services-appset:16.0.2'

OPTIONAL: Mediation Android Sample App 🔗

The Chartboost Mediation Demo App is available on our public GitHub repo.