Admob Adapter Installation

Android Admob Adapter Installation

Requirements

  • The Appnext AdMob Adapter supports Android API 26+ when building for Android
  • The Appnext AdMob Adapter requires internet access to pull ads information for your app

Adapter Integration

Latest version: 2.7.4.473 (released on February 20, 2024)

Using Gradle

Before updating a new SDK version, it is recommended to clear the Gradle cache and recompile the project.

Step 1: Define the root level gradle of the project

You need to paste it into the project gradle (Project integration App)

allprojects {
  repositories {
  maven { url "http://dl.appnext.com/" }
 }
}

Step 2: Define in the module build.gradle

You need to paste to the module gradle (Module App)

You're done! Go ahead and choose an ad unit to integrate with the adapter!

dependencies {
  implementation 'com.appnext.sdk.adapters:admob-ads:2.7.4.473' // Mandatory for interstitial and fullscreen/rewarded video ad units
  implementation 'com.appnext.sdk.adapters:admob-banners:2.7.4.473' // Mandatory for banners ad unit
  implementation 'com.google.android.gms:play-services-ads:2.7.4.473' // Mandatory
}

Manual Integration (Not Recommended)

Step 1: Download the ZIP file with the SDK and adapter AAR files

Download the AAR files from here
The ZIP file includes the following AAR files;

  • AppnextAndroidSDKCore.aar - The SDK core
  • AppnextAndroidSDKAds.aar - For the interstitial and fullscreen/rewarded ad units
  • AppnextAndroidSDKBanners.aar - For the banners ad unit
  • AppnextAndroidSDKNativeAds.aar - For the native ads ad unit
  • AppnextAndroidSDKActions.aar - For the actions ad unit
  • AppnextAndroidAdmobAdapterAds.aar - The interstitial and fullscreen/rewarded ad units Admob adapter
  • AppnextAndroidAdmobAdapterBanners.aar - The banners ad unit Admob adapter

Step 2: Add the AAR files to Your Project

Extract the ZIP file and add the relevant AAR files to your "libs" folder in your project;

  • You must add the AppnextAndroidSDKCore.aar file (make sure to add it only once)
  • Add other AAR files according to your relevant ad unit integration
  • Add the relevant Mopub adapter AAR file accordingly
  • All AAR files must be from the same version (download the latest ZIP file to be sure)

Ad the following code to the project's build.gradle

allprojects {
   repositories {
      jcenter()
      flatDir {
        dirs 'libs'
      }
   }
}

Step 3: Add the following code to the module's build.gradle

For example, adding the Ads AAR with the adapter AAR file:

dependencies {
  implementation name:'AppnextAndroidSDKCore.aar', ext:'aar' // Mandatory
  implementation name:'AppnextAndroidSDKAds.aar', ext:'aar'
  implementation name:'AppnextAndroidAdmobAdapterAds.aar', ext:'aar'
  implementation 'com.google.android.gms:play-services-ads:21.1.0' // Mandatory
}

Step 4: ProGuard

Exclude Appnext from your proguard by using the line:

-keep class com.appnext.** { *; }
-dontwarn com.appnext.**

You're done! Go ahead and choose an ad unit to integrate with the adapter!

Example Project

You can download an example project (Android Studio) from here.


What’s Next

Integrate one of the adapter's ad units