You can download and integrate the MAX mediation adapters into your app in two ways:
Gradle
AppLovin recommends that you integrate adapters this way.
AppLovin’s adapters’ POM files automatically integrate the mediated network’s SDK and its dependencies.
Open Source Adapters
If you require more flexibility in the integration, you can integrate AppLovin’s open source adapters.
You are responsible for integrating the mediated SDKs and their dependencies.
You can find these adapters in the AppLovn-MAX-SDK-Android GitHub repository .
Gradle
Choose which mediated ad networks you want to integrate by checking the boxes below.
When you check those boxes, this page displays instructions specific to those networks.
This page also customizes a Gradle script for you.
Copy the customized Gradle script below to your app-level build.gradle
.
maven { url " https://artifactory.bidmachine.io/bidmachine " }
maven { url " https://cboost.jfrog.io/artifactory/chartboost-ads/ " }
maven { url " https://android-sdk.is.com " }
maven { url " https://imobile-maio.github.io/maven " }
maven { url " https://dl-maven-android.mintegral.com/repository/mbridge_android_sdk_oversea " }
maven { url " https://maven.ogury.co " }
maven { url " https://artifact.bytedance.com/repository/pangle " }
maven { url " https://repo.pubmatic.com/artifactory/public-repos " }
maven { url " https://s3.amazonaws.com/smaato-sdk-releases/ " }
maven { url " https://verve.jfrog.io/artifactory/verve-gradle-release " }
maven { url " https://ysonetwork.s3.eu-west-3.amazonaws.com/sdk/android " }
implementation ' com.applovin:applovin-sdk:+ '
implementation ' com.applovin.mediation:amazon-tam-adapter:+ '
implementation ' com.amazon.android:aps-sdk:+ '
implementation ' com.applovin.mediation:bidmachine-adapter:+ '
implementation ' com.applovin.mediation:bigoads-adapter:+ '
implementation ' com.applovin.mediation:chartboost-adapter:+ '
implementation ' com.google.android.gms:play-services-base:16.1.0 '
implementation ' com.applovin.mediation:fyber-adapter:+ '
implementation ' com.applovin.mediation:google-ad-manager-adapter:+ '
implementation ' com.applovin.mediation:google-adapter:+ '
implementation ' com.applovin.mediation:hyprmx-adapter:+ '
implementation ' com.applovin.mediation:inmobi-adapter:+ '
implementation ' com.squareup.picasso:picasso:2.71828 '
implementation ' androidx.recyclerview:recyclerview:1.1.0 '
implementation ' com.applovin.mediation:ironsource-adapter:+ '
implementation ' com.applovin.mediation:vungle-adapter:+ '
implementation ' com.applovin.mediation:line-adapter:+ '
implementation ' com.applovin.mediation:maio-adapter:+ '
implementation ' com.applovin.mediation:facebook-adapter:+ '
implementation ' com.applovin.mediation:mintegral-adapter:+ '
implementation ' com.applovin.mediation:mobilefuse-adapter:+ '
implementation ' com.applovin.mediation:moloco-adapter:+ '
implementation ' com.applovin.mediation:ogury-presage-adapter:+ '
implementation ' com.applovin.mediation:bytedance-adapter:+ '
implementation ' com.applovin.mediation:pubmatic-adapter:+ '
implementation ' com.applovin.mediation:smaato-adapter:+ '
implementation ' com.applovin.mediation:unityads-adapter:+ '
implementation ' com.applovin.mediation:verve-adapter:+ '
implementation ' com.applovin.mediation:mytarget-adapter:+ '
implementation ' com.applovin.mediation:yandex-adapter:+ '
implementation ' com.applovin.mediation:yso-network-adapter:+ '
maven { url = uri ( "https://artifactory.bidmachine.io/bidmachine" ) }
maven { url = uri ( "https://cboost.jfrog.io/artifactory/chartboost-ads/" ) }
maven { url = uri ( "https://android-sdk.is.com" ) }
maven { url = uri ( "https://imobile-maio.github.io/maven" ) }
maven { url = uri ( "https://dl-maven-android.mintegral.com/repository/mbridge_android_sdk_oversea" ) }
maven { url = uri ( "https://maven.ogury.co" ) }
maven { url = uri ( "https://artifact.bytedance.com/repository/pangle" ) }
maven { url = uri ( "https://repo.pubmatic.com/artifactory/public-repos" ) }
maven { url = uri ( "https://s3.amazonaws.com/smaato-sdk-releases/" ) }
maven { url = uri ( "https://verve.jfrog.io/artifactory/verve-gradle-release" ) }
maven { url = uri ( "https://ysonetwork.s3.eu-west-3.amazonaws.com/sdk/android" ) }
implementation ( "com.applovin:applovin-sdk:+" )
implementation ( "com.applovin.mediation:amazon-tam-adapter:+" )
implementation ( "com.amazon.android:aps-sdk:+" )
implementation ( "com.applovin.mediation:bidmachine-adapter:+" )
implementation ( "com.applovin.mediation:bigoads-adapter:+" )
implementation ( "com.applovin.mediation:chartboost-adapter:+" )
implementation ( "com.google.android.gms:play-services-base:16.1.0" )
implementation ( "com.applovin.mediation:fyber-adapter:+" )
implementation ( "com.applovin.mediation:google-ad-manager-adapter:+" )
implementation ( "com.applovin.mediation:google-adapter:+" )
implementation ( "com.applovin.mediation:hyprmx-adapter:+" )
implementation ( "com.applovin.mediation:inmobi-adapter:+" )
implementation ( "com.squareup.picasso:picasso:2.71828" )
implementation ( "androidx.recyclerview:recyclerview:1.1.0" )
implementation ( "com.applovin.mediation:ironsource-adapter:+" )
implementation ( "com.applovin.mediation:vungle-adapter:+" )
implementation ( "com.applovin.mediation:line-adapter:+" )
implementation ( "com.applovin.mediation:maio-adapter:+" )
implementation ( "com.applovin.mediation:facebook-adapter:+" )
implementation ( "com.applovin.mediation:mintegral-adapter:+" )
implementation ( "com.applovin.mediation:mobilefuse-adapter:+" )
implementation ( "com.applovin.mediation:moloco-adapter:+" )
implementation ( "com.applovin.mediation:ogury-presage-adapter:+" )
implementation ( "com.applovin.mediation:bytedance-adapter:+" )
implementation ( "com.applovin.mediation:pubmatic-adapter:+" )
implementation ( "com.applovin.mediation:smaato-adapter:+" )
implementation ( "com.applovin.mediation:unityads-adapter:+" )
implementation ( "com.applovin.mediation:verve-adapter:+" )
implementation ( "com.applovin.mediation:mytarget-adapter:+" )
implementation ( "com.applovin.mediation:yandex-adapter:+" )
implementation ( "com.applovin.mediation:yso-network-adapter:+" )
Migrating to AndroidX
Integrate AndroidX libraries into your project.
Refer to the Migrate to AndroidX guide for more information on how to migrate your project.
Note
Developers and publishers who use Google AdSense, AdManager, or AdMob must use a consent management platform (CMP) that is certified by Google.
The CMP must integrate with IAB’s Transparency and Consent Framework when you serve ads to users in the European Economic Area (EEA) or the UK.
See Privacy: “TCF v2 Consent” for more information.
Add Your Google Bidding and Google AdMob / Google Ad Manager App ID
In your app’s AndroidManifest.xml
, add a <meta-data>
tag inside the <application>
tag.
The example below shows you the correct attributes of this tag.
Replace «your-admob-app-id»
with your Google bidding and Google AdMob / Google Ad Manager App ID.
<? xml version = " 1.0 " encoding = " utf-8 " ?>
android:name = " com.google.android.gms.ads.APPLICATION_ID "
android:value = " «your-admob-app-id» " />
Gradle Errors
Google AdMob requires Android Gradle plugin version 4.2.0 or higher and Gradle version 6.7.1 or higher.
If you see the following error, update your Android Gradle plugin and Gradle versions:
AAPT: error: unexpected element <property> found in <manifest><application>.
compileSdkVersion
You set the compileSdkVersion
of your app in build.gradle
.
Google Mobile Ads SDK versions 20.5.0 and newer require that you set compileSdkVersion
to 31
.
Google Mobile Ads SDK version 20.4.0.1 is the most recent version that still supports setting compileSdkVersion
to 30
.
Initialize the Amazon SDK
The Amazon Publisher Services SDK requires that you initialize it outside of MAX SDK:
// Amazon requires an 'Activity' instance
AdRegistration . getInstance ( " AMAZON_APP_ID " , this ) ;
AdRegistration . setAdNetworkInfo ( new DTBAdNetworkInfo ( DTBAdNetwork . MAX ) ) ;
AdRegistration . setMRAIDSupportedVersions ( new String [] { " 1.0 " , " 2.0 " , " 3.0 " } ) ;
AdRegistration . setMRAIDPolicy ( MRAIDPolicy . CUSTOM ) ;
Load a Banner or MREC Ad from Amazon’s SDK
To integrate Amazon ads into MAX, you must load the Amazon ad first.
Before you load the MAX ad, pass the DTBAdResponse
or AdError
into the instance of MaxAdView
.
You can do this by calling MaxAdView#setLocalExtraParameter()
.
if ( AppLovinSdkUtils . isTablet ( getApplicationContext () ) )
amazonAdSlotId = " «Amazon-leader-slot-ID» " ;
adFormat = MaxAdFormat . LEADER ;
amazonAdSlotId = " «Amazon-banner-slot-ID» " ;
adFormat = MaxAdFormat . BANNER ;
// Raw size will be 320x50 for BANNERs on phones, and 728x90 for LEADERs on tablets
AppLovinSdkUtils . Size rawSize = adFormat . getSize () ;
DTBAdSize size = new DTBAdSize ( rawSize .getWidth () , rawSize .getHeight () , amazonAdSlotId ) ;
DTBAdRequest adLoader = new DTBAdRequest () ;
adLoader . setSizes ( size ) ;
adLoader . loadAd ( new DTBAdCallback ()
public void onSuccess ( @ NonNull final DTBAdResponse dtbAdResponse )
// 'adView' is your instance of MaxAdView
adView . setLocalExtraParameter ( " amazon_ad_response " , dtbAdResponse ) ;
public void onFailure ( @ NonNull final AdError adError )
// 'adView' is your instance of MaxAdView
adView . setLocalExtraParameter ( " amazon_ad_error " , adError ) ;
class ExampleActivity : Activity()
private val adView: MaxAdView? = null
val amazonAdSlotId: String
val adFormat: MaxAdFormat
if (AppLovinSdkUtils. isTablet (applicationContext))
amazonAdSlotId = " «Amazon-leader-slot-ID» "
adFormat = MaxAdFormat.LEADER
amazonAdSlotId = " «Amazon-banner-slot-ID» "
adFormat = MaxAdFormat.BANNER
// Raw size will be 320x50 for BANNERs on phones, and 728x90 for LEADERs on tablets
val rawSize = adFormat.size
val size = DTBAdSize (rawSize.width, rawSize.height, amazonAdSlotId)
val adLoader = DTBAdRequest ()
adLoader. loadAd ( object : DTBAdCallback
override fun onSuccess (dtbAdResponse: DTBAdResponse)
// 'adView' is your instance of MaxAdView
adView?. setLocalExtraParameter ( "amazon_ad_response" , dtbAdResponse)
override fun onFailure (adError: AdError)
// 'adView' is your instance of MaxAdView
adView?. setLocalExtraParameter ( "amazon_ad_error" , adError)
DTBAdRequest adLoader = new DTBAdRequest () ;
adLoader . setSizes ( new DTBAdSize ( 300 , 250 , amazonAdSlotId ) ) ;
adLoader . loadAd ( new DTBAdCallback ()
public void onSuccess ( @ NonNull final DTBAdResponse dtbAdResponse )
// 'adView' is your instance of MaxAdView
adView . setLocalExtraParameter ( " amazon_ad_response " , dtbAdResponse ) ;
public void onFailure ( @ NonNull final AdError adError )
// 'adView' is your instance of MaxAdView
adView . setLocalExtraParameter ( " amazon_ad_error " , adError ) ;
class ExampleActivity : Activity()
private val adView: MaxAdView? = null
val amazonAdSlotId: String
val adLoader = DTBAdRequest ()
adLoader. setSizes ( DTBAdSize ( 300 , 250 , amazonAdSlotId))
adLoader. loadAd ( object : DTBAdCallback
override fun onSuccess (dtbAdResponse: DTBAdResponse)
// 'adView' is your instance of MaxAdView
adView !! . setLocalExtraParameter ( "amazon_ad_response" , dtbAdResponse)
override fun onFailure (adError: AdError)
// 'adView' is your instance of MaxAdView
adView !! . setLocalExtraParameter ( "amazon_ad_error" , adError)
Load an Interstitial Ad from Amazon’s SDK
To integrate Amazon interstitial ads into MAX, you must load the Amazon ad first.
Before you load the MAX ad, pass the DTBAdResponse
or AdError
into the instance of MaxInterstitialAd
.
You can do this by calling MaxInterstitialAd#setLocalExtraParameter()
.
private static MaxInterstitialAd interstitialAd ; // static to ensure only one instance exists
private static boolean isFirstLoad = true ;
if ( interstitialAd == null )
interstitialAd = new MaxInterstitialAd ( " «MAX-inter-ad-unit-ID» " , this ) ;
DTBAdRequest adLoader = new DTBAdRequest () ;
adLoader . setSizes ( new DTBAdSize. DTBInterstitialAdSize ( " «Amazon-inter-slot-ID» " ) ) ;
adLoader . loadAd ( new DTBAdCallback ()
public void onSuccess ( @ NonNull final DTBAdResponse dtbAdResponse )
// 'interstitialAd' is your instance of MaxInterstitialAd
interstitialAd . setLocalExtraParameter ( " amazon_ad_response " , dtbAdResponse ) ;
public void onFailure ( @ NonNull final AdError adError )
// 'interstitialAd' is your instance of MaxInterstitialAd
interstitialAd . setLocalExtraParameter ( " amazon_ad_error " , adError ) ;
class ExampleActivity : Activity()
private var interstitialAd: MaxInterstitialAd? = null // static to ensure only one instance exists
private var isFirstLoad = true
if (interstitialAd == null )
interstitialAd = MaxInterstitialAd ( " «MAX-inter-ad-unit-ID» " , this )
val adLoader = DTBAdRequest ()
adLoader. setSizes (DTBAdSize. DTBInterstitialAdSize ( " «Amazon-inter-slot-ID» " ))
adLoader. loadAd ( object : DTBAdCallback
override fun onSuccess (dtbAdResponse: DTBAdResponse)
// 'interstitialAd' is your instance of MaxInterstitialAd
interstitialAd !! . setLocalExtraParameter ( "amazon_ad_response" , dtbAdResponse)
interstitialAd !! . loadAd ()
override fun onFailure (adError: AdError)
// 'interstitialAd' is your instance of MaxInterstitialAd
interstitialAd !! . setLocalExtraParameter ( "amazon_ad_error" , adError)
interstitialAd !! . loadAd ()
interstitialAd !! . loadAd ()
Load a Video Interstitial Ad from Amazon’s SDK
To integrate Amazon video interstitial ads into MAX, you must load the Amazon ad first.
Before you load the MAX ad, pass the DTBAdResponse
or AdError
into the instance of MaxInterstitialAd
.
You can do this by calling MaxInterstitialAd#setLocalExtraParameter()
.
private static MaxInterstitialAd interstitialAd ; // static to ensure only one instance exists
private static boolean isFirstLoad = true ;
if ( interstitialAd == null )
interstitialAd = new MaxInterstitialAd ( " «MAX-inter-ad-unit-ID» " , this ) ;
DTBAdRequest adLoader = new DTBAdRequest () ;
// Switch video player width and height values(320, 480) depending on device orientation
adLoader . setSizes ( new DTBAdSize. DTBVideo ( 320 , 480 , " «Amazon-video-inter-slot-ID» " ) ) ;
adLoader . loadAd ( new DTBAdCallback ()
public void onSuccess ( @ NonNull final DTBAdResponse dtbAdResponse )
// 'interstitialAd' is your instance of MaxInterstitialAd
interstitialAd . setLocalExtraParameter ( " amazon_ad_response " , dtbAdResponse ) ;
public void onFailure ( @ NonNull final AdError adError )
// 'interstitialAd' is your instance of MaxInterstitialAd
interstitialAd . setLocalExtraParameter ( " amazon_ad_error " , adError ) ;
class ExampleActivity : Activity()
private var interstitialAd: MaxInterstitialAd? = null // static to ensure only one instance exists
private var isFirstLoad = true
if (interstitialAd == null )
interstitialAd = MaxInterstitialAd ( " «MAX-inter-ad-unit-iD» " , this )
val adLoader = DTBAdRequest ()
// Switch video player width and height values(320, 480) depending on device orientation
adLoader. setSizes (DTBAdSize. DTBVideo ( 320 , 480 , " «Amazon-video-inter-slot-ID» " ))
adLoader. loadAd ( object : DTBAdCallback
override fun onSuccess (dtbAdResponse: DTBAdResponse)
// 'interstitialAd' is your instance of MaxInterstitialAd
interstitialAd !! . setLocalExtraParameter ( "amazon_ad_response" , dtbAdResponse)
interstitialAd !! . loadAd ()
override fun onFailure (adError: AdError)
// 'interstitialAd' is your instance of MaxInterstitialAd
interstitialAd !! . setLocalExtraParameter ( "amazon_ad_error" , adError)
interstitialAd !! . loadAd ()
interstitialAd !! . loadAd ()
Load a Rewarded Video Ad from Amazon’s SDK
To integrate Amazon rewarded videos into MAX, first load the Amazon ad.
Before you load the MAX ad, pass the DTBAdResponse
or AdError
into the instance of MaxRewardedAd
.
You can do this by calling MaxRewardedAd#setLocalExtraParameter()
.
private static MaxRewardedAd rewardedAd ; // static to ensure only one instance exists
private static boolean isFirstLoad = true ;
if ( rewardedAd == null )
rewardedAd = MaxRewardedAd . getInstance ( " «MAX-rewarded-ad-unit-ID» " , this ) ;
DTBAdRequest adLoader = new DTBAdRequest () ;
// Switch video player width and height values(320, 480) depending on device orientation
adLoader . setSizes ( new DTBAdSize. DTBVideo ( 320 , 480 , " «Amazon-video-rewarded-slot-ID» " ) ) ;
adLoader . loadAd ( new DTBAdCallback ()
public void onSuccess ( @ NonNull final DTBAdResponse dtbAdResponse )
// 'rewardedAd' is your instance of MaxRewardedAd
rewardedAd . setLocalExtraParameter ( " amazon_ad_response " , dtbAdResponse ) ;
public void onFailure ( @ NonNull final AdError adError )
// 'rewardedAd' is your instance of MaxRewardedAd
rewardedAd . setLocalExtraParameter ( " amazon_ad_error " , adError ) ;
private static MaxRewardedAd rewardedAd; // static to ensure only one instance exists
private static boolean isFirstLoad = true ;
if ( rewardedAd == null )
rewardedAd = MaxRewardedAd. getInstance ( " «MAX-rewarded-ad-unit-ID» " , this );
DTBAdRequest adLoader = new DTBAdRequest ();
// Switch video player width and height values(320, 480) depending on device orientation
adLoader. setSizes ( new DTBAdSize. DTBVideo ( 320 , 480 , " «Amazon-video-rewarded-slot-ID» " ) );
adLoader. loadAd ( new DTBAdCallback ()
public void onSuccess (@NonNull final DTBAdResponse dtbAdResponse)
// 'rewardedAd' is your instance of MaxRewardedAd
rewardedAd. setLocalExtraParameter ( "amazon_ad_response" , dtbAdResponse );
public void onFailure (@NonNull final AdError adError)
// 'rewardedAd' is your instance of MaxRewardedAd
rewardedAd. setLocalExtraParameter ( "amazon_ad_error" , adError );
Testing Amazon Publisher Services
AppLovin recommends that you enable test mode for Amazon’s SDK.
This allows you to receive test ads.
Enable test mode by making the following calls:
AdRegistration . enableTesting ( true ) ;
AdRegistration . enableLogging ( true ) ;
You can filter your waterfalls to contain only Amazon ads.
To do this, navigate to Select Live Network in the Mediation Debugger and select the Amazon network.
Meta Audience Network Data Processing Options
If you do not want to enable Limited Data Use (LDU) mode, pass SetDataProcessingOptions()
an empty string array:
import com.facebook.ads.AdSettings ;
AdSettings . setDataProcessingOptions ( new String [] {} ) ;
import com.facebook.ads.AdSettings
AdSettings. setDataProcessingOptions ( arrayOf <String>() )
To enable LDU for users and specify user geography, call SetDataProcessingOptions()
in a form like this:
import com.facebook.ads.AdSettings ;
AdSettings . setDataProcessingOptions ( new String [] { " LDU " }, «country» , «state» ) ;
import com.facebook.ads.AdSettings
AdSettings. setDataProcessingOptions ( arrayOf ( "LDU" ), «country» , «state» )
Using Google UMP
If you use Google UMP as your CMP, you can determine whether the user has consented to Meta or not.
To do so, use code like the following:
Boolean hasMetaConsent = AppLovinPrivacySettings . getAdditionalConsentStatus ( 89 ) ;
if ( hasMetaConsent != null )
// Set Meta Data Processing Options accordingly.
// AC String is not available on disk. Please check for consent status after the user completes the CMP flow.
val hasMetaConsent = AppLovinPrivacySettings. getAdditionalConsentStatus ( 89 )
if ( hasMetaConsent != null )
// Set Meta Data Processing Options accordingly.
// AC String is not available on disk. Please check for consent status after the user completes the CMP flow.
Meta Audience Network Data Processing Options for Users in California
To learn how to implement Meta Audience Network’s “Limited Data Use” flag in California, visit the Meta for Developers documentation .
Android Manifest Merging Errors
Several network SDKs use the <queries>
element in their bundled Android Manifest files.
If you use an incompatible version of the Android Gradle plugin, this causes one of the following build errors:
com.android.builder.internal.aapt.v2.Aapt2Exception: Android resource linking failed
error: unexpected element <queries> found in <manifest>.
Missing 'package' key attribute on element package at [:com.my.target.mytarget-sdk-5.11.3:]
AndroidManifest Validation failed
To fix this error, upgrade to one of the following versions of the Android Gradle plugin.
These versions support the <queries>
element:
Current Android Gradle Plugin Version Version that Supports <queries>
Element 4.1.* All 4.0.* 4.0.1+ 3.6.* 3.6.4+ 3.5.* 3.5.4+ 3.4.* 3.4.3+ 3.3.* 3.3.3+