Skip to main content

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.

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.

settings.gradle.kts
pluginManagement {
repositories {
google()
mavenCentral()
gradlePluginPortal()
maven { url = uri("https://maven.empower.net/release") }
}
}

plugins {
id("net.empower.mobile.ads.settings") version "5.8.1"
}

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:

BundleUse when
empower-mobile-ads-mediationDefault. minSdk 23 or higher, Google Mobile Ads 24.0.0 or newer.
empower-mobile-ads-mediation-legacyminSdk 21 or 22, or a project that must stay on Google Mobile Ads below 24.
app/build.gradle.kts
dependencies {
implementation("net.empower.mobile.ads:empower-mobile-ads:5.8.1")
implementation("net.empower.mobile.ads:empower-mobile-ads-mediation:5.8.1")
}
Using the legacy bundle

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.

app/build.gradle.kts
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")
}

Step 4: Add the Google App ID

Add the Empower application ID inside the <application> tag of your AndroidManifest.xml, exactly as below:

<manifest>
<application>
<meta-data
android:name="com.google.android.gms.ads.APPLICATION_ID"
android:value="ca-app-pub-6593523210010154~7395142271"/>
</application>
</manifest>
warning

If this meta-data entry is missing or wrong, the app crashes at startup with "The Google Mobile Ads SDK was initialized incorrectly". Use the value exactly as shown.

Next Steps

The SDK is now part of your project. Continue with Privacy & Consent to handle user consent, then Configuration to initialize the SDK, and finally implement the ad formats your app uses.