To load an interstitial ad, instantiate a MaxInterstitialAd object with your ad unit and call loadAd().
Implement MaxAdListener so you can be notified when your ad is ready and of other ad-related events.
To show an interstitial ad, call showAd() on the MaxInterstitialAd object created above.
To load a rewarded ad, retrieve a MaxRewardedAd object with your rewarded ad unit and call loadAd() on it.
Implement MaxRewardedAdListener so you can be notified when your ad is ready and of other ad-related events.
To show a rewarded ad, call showAd() on the MaxRewardedAd object you created above.
To load a banner ad or MREC, create a MaxAdView object with your ad unit and call loadAd().
To show, add the MaxAdView object as a subview of your view hierarchy.
Implement MaxAdViewAdListener so you can be notified when your ad is ready and of other ad-related events.
You can also add MAX banners or MRECs to your view layout XML.
Ensure that your ads are fully functional by setting a background or background color (android:background).
For banners, stretch the width (android:layout_width) to the width of the screen.
For MRECs, set the android:adFormat accordingly:
Declare the base banner height of 50 dp in res/values/attrs.xml:
Declare the tablet banner height of 90 dp in res/values-sw600dp/attrs.xml:
To hide a banner or MREC ad, call the following:
To show a banner or MREC ad, call the following:
Select the ad networks to integrate. Then follow the specific instructions.
[COMPONENT: NetworkConfigurator]
[COMPONENT: ConfiguratorSection]
[COMPONENT: ConfiguratorSection]
[COMPONENT: ConfiguratorSection]
[COMPONENT: ConfiguratorSection]
[COMPONENT: ConfiguratorSection]
[COMPONENT: ConfiguratorSection]
[COMPONENT: ConfiguratorSection]
[COMPONENT: ConfiguratorSection]
[COMPONENT: ConfiguratorSection]
[COMPONENT: ConfiguratorSection]
[COMPONENT: ManualDownloadsTable]
To receive release updates, subscribe to the AppLovin-MAX-SDK-Android GitHub repository.
[COMPONENT: DownloadButton]
Unzip the downloaded file, then drag and drop the aar file to the libs folder in your project.
(If your project does not have a libs folder, you can create one inside the app folder.)
Add the following to your build.gradle file:
Add the following line into your AndroidManifest.xml.
This needs to go inside the application tag:
You can find your SDK key in the Account > General > Keys section of the AppLovin dashboard.
To enable the MAX Ad Review service, add the following to your build.gradle files:
build.gradle filebuild.gradle fileYou can find your Ad Review Key in the Account > General > Keys section of the AppLovin dashboard.
Before you initialize the SDK, create an initialization configuration object for the SDK.
This object allows you to configure the properties that the SDK will initialize with.
These initialization properties are immutable, except AppLovinSdkSettings which contains mutable properties that can change during the lifetime of the app.
You can find your SDK key in the Account > General > Keys section of the AppLovin dashboard.
Initialize the AppLovin SDK with the initialization configuration object as early as possible (for example, in the onCreate() of the launch activity or Application class).
This maximizes how much time the SDK has to cache mediated networks’ ads, which results in a better user experience.
Below is a sample integration.
To learn how to receive callbacks to your currency server, see the MAX S2S rewarded callback API guide and update the S2S Rewarded Callback URL in your Edit Ad Unit page.