Integration
This guide explains how to add the Empower Mobile Ads SDK to your Android project.
Step 1: Configure Repositories
There are two ways to set up the repositories. Follow only one of the tabs below. The settings plugin is recommended. Choose the manual setup only when third-party Gradle plugins are restricted in your project.
- Settings plugin
- Manual repositories
Add the Empower maven to pluginManagement.repositories, then apply the settings plugin. From here Empower manages the repository setup for you: the plugin registers every Maven repository the SDK and its mediation adapters need. When a future release adds or removes a network, updating the plugin version is the only change on your side.
- Kotlin DSL
- Groovy
pluginManagement {
repositories {
google()
mavenCentral()
gradlePluginPortal()
maven { url = uri("https://maven.empower.net/release") }
}
}
plugins {
id("net.empower.mobile.ads.settings") version "5.8.1"
}
pluginManagement {
repositories {
google()
mavenCentral()
gradlePluginPortal()
maven { url 'https://maven.empower.net/release' }
}
}
plugins {
id 'net.empower.mobile.ads.settings' version '5.8.1'
}
Declare every Maven repository the SDK needs yourself. You will need to add new repositories manually when the SDK adds networks in future releases. Do not apply the settings plugin when using this path.
- Kotlin DSL
- Groovy
dependencyResolutionManagement {
repositories {
google()
mavenCentral()
// Empower Mobile Ads SDK
maven {
url = uri("https://maven.empower.net/release")
content { includeGroup("net.empower.mobile.ads") }
}
// AppLovin SDK & mediation adapters
maven {
url = uri("https://artifacts.applovin.com/android")
content { includeGroupByRegex("com\\.applovin.*") }
}
// Pangle / ByteDance
maven {
url = uri("https://artifact.bytedance.com/repository/pangle/")
content { includeGroupByRegex("com\\.(bytedance|pangle).*") }
}
// IronSource / Fyber / DT Exchange
maven {
url = uri("https://android-sdk.is.com/")
content { includeGroupByRegex("com\\.(ironsource|fyber).*") }
}
// Ogury
maven {
url = uri("https://maven.ogury.co")
content { includeGroupByRegex("co\\.ogury.*") }
}
}
}
dependencyResolutionManagement {
repositories {
google()
mavenCentral()
// Empower Mobile Ads SDK
maven {
url 'https://maven.empower.net/release'
content { includeGroup 'net.empower.mobile.ads' }
}
// AppLovin SDK & mediation adapters
maven {
url 'https://artifacts.applovin.com/android'
content { includeGroupByRegex 'com\\.applovin.*' }
}
// Pangle / ByteDance
maven {
url 'https://artifact.bytedance.com/repository/pangle/'
content { includeGroupByRegex 'com\\.(bytedance|pangle).*' }
}
// IronSource / Fyber / DT Exchange
maven {
url 'https://android-sdk.is.com/'
content { includeGroupByRegex 'com\\.(ironsource|fyber).*' }
}
// Ogury
maven {
url 'https://maven.ogury.co'
content { includeGroupByRegex 'co\\.ogury.*' }
}
}
}
Mediation adapter versions
With the manual setup you also manage the mediation adapter versions yourself. Use exactly the versions below; they are the ones tested with this SDK release, and other combinations are not supported:
- Kotlin DSL
- Groovy
implementation("com.applovin.mediation:google-adapter:25.2.0.0")
implementation("com.applovin.mediation:google-ad-manager-adapter:25.2.0.0")
implementation("com.applovin.mediation:vungle-adapter:7.7.4.0")
implementation("com.applovin.mediation:bytedance-adapter:8.1.0.3.0")
implementation("com.applovin.mediation:inmobi-adapter:11.3.0.0")
implementation("com.applovin.mediation:fyber-adapter:8.4.5.0")
implementation("com.applovin.mediation:ogury-presage-adapter:6.2.2.0")
implementation("com.google.ads.mediation:inmobi:11.2.0.0")
implementation("com.google.ads.mediation:pangle:8.0.0.4.0")
implementation("com.google.ads.mediation:vungle:7.7.2.0")
implementation("com.squareup.picasso:picasso:2.71828") // required by InMobi
implementation 'com.applovin.mediation:google-adapter:25.2.0.0'
implementation 'com.applovin.mediation:google-ad-manager-adapter:25.2.0.0'
implementation 'com.applovin.mediation:vungle-adapter:7.7.4.0'
implementation 'com.applovin.mediation:bytedance-adapter:8.1.0.3.0'
implementation 'com.applovin.mediation:inmobi-adapter:11.3.0.0'
implementation 'com.applovin.mediation:fyber-adapter:8.4.5.0'
implementation 'com.applovin.mediation:ogury-presage-adapter:6.2.2.0'
implementation 'com.google.ads.mediation:inmobi:11.2.0.0'
implementation 'com.google.ads.mediation:pangle:8.0.0.4.0'
implementation 'com.google.ads.mediation:vungle:7.7.2.0'
implementation 'com.squareup.picasso:picasso:2.71828' // required by InMobi
Step 2: Add the SDK Dependencies
Add two dependencies in your app module: the core SDK and one mediation bundle. Pick the bundle that matches your project:
| Bundle | Use when |
|---|---|
empower-mobile-ads-mediation | Default. minSdk 23 or higher, Google Mobile Ads 24.0.0 or newer. |
empower-mobile-ads-mediation-legacy | minSdk 21 or 22, or a project that must stay on Google Mobile Ads below 24. |
- Kotlin DSL
- Groovy
dependencies {
implementation("net.empower.mobile.ads:empower-mobile-ads:5.8.1")
implementation("net.empower.mobile.ads:empower-mobile-ads-mediation:5.8.1")
}
dependencies {
implementation 'net.empower.mobile.ads:empower-mobile-ads:5.8.1'
implementation 'net.empower.mobile.ads:empower-mobile-ads-mediation:5.8.1'
}
Replace empower-mobile-ads-mediation with empower-mobile-ads-mediation-legacy in the dependency line above.
Step 3: Project Compatibility (Java 11 + Desugaring)
Your app module must compile with Java 11 and have core library desugaring enabled.
- Kotlin DSL
- Groovy
android {
compileOptions {
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
isCoreLibraryDesugaringEnabled = true
}
}
kotlin {
jvmToolchain(11)
}
dependencies {
coreLibraryDesugaring("com.android.tools:desugar_jdk_libs:2.1.5")
}
android {
compileOptions {
sourceCompatibility JavaVersion.VERSION_11
targetCompatibility JavaVersion.VERSION_11
coreLibraryDesugaringEnabled true
}
kotlinOptions {
jvmTarget = '11'
}
}
dependencies {
coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:2.1.5'
}