Android SDK Integration

Integrating the SDK

The easiest way to integrate SDK to your Android project is to use Maven Repository.

Step 1: Simply open your project's app level build.gradle file and add the EMA SDK as dependency:

implementation 'net.empower.mobile.ads:empower-mobile-ads:4.13.16'

Step 2: Add the following line to your project's project level build.gradle file:

maven { url "https://maven.empower.net/release" }

Update Your AndroidManifest.xml

Replace value with your app id that will be provided by us by adding following lines to AndroidManifest.xml:

<application>
<!-- Sample Ad Manager app ID: ca-app-pub-3940256099942544~3347511713 -->
<meta-data
android:name="com.google.android.gms.ads.APPLICATION_ID"
android:value="ca-app-pub-xxxxxxxxxxxxxxxx~yyyyyyyyyy"/>
</application>

Build Settings

Go to your app level build.gradle file and add the following code inside android tag to support Java 8 features:

compileOptions {
sourceCompatibility 1.8
targetCompatibility 1.8
}

If you are using Kotlin in your project, add following lines to your app level build.gradle file:

kotlinOptions {
jvmTarget = '1.8'
freeCompilerArgs = ['-Xjvm-default=compatibility']
}

Add enableJetifier=true to your gradle.properties file.

Integrating Mediation Networks

You need to follow the Google's documentation on the following mediation bidding networks to integrate their SDKs. Before implementing mediation networks, please add following code snippet to the Application class or MainActivity.

MobileAds.initialize(this) { initializationStatus ->
val statusMap =
initializationStatus.adapterStatusMap
for (adapterClass in statusMap.keys) {
val status = statusMap[adapterClass]
Log.d("EmpowerMobileAds", String.format(
"Adapter name: %s, Description: %s, Latency: %d",
adapterClass, status!!.description, status.latency))
}
}
MobileAds.initialize(this, new OnInitializationCompleteListener() {
@Override
public void onInitializationComplete(InitializationStatus initializationStatus) {
Map<String, AdapterStatus> statusMap = initializationStatus.getAdapterStatusMap();
for (String adapterClass : statusMap.keySet()) {
AdapterStatus status = statusMap.get(adapterClass);
Log.d("EmpowerMobileAds", String.format(
"Adapter name: %s, Description: %s, Latency: %d",
adapterClass, status.getDescription(), status.getLatency()));
}
}
});
**AdColony:** Please follow the [Step 3](https://developers.google.com/admob/android/mediation/adcolony#step_3_import_the_adcolony_sdk_and_adapter).

Pangle: Please follow the Step 3 and the Step 4.

Meta: Please follow the Step 3.

Liftoff Monetize: Please follow the Step 3.

App Lovin: Please follow the Step 3.