AppLovinMax_Android_Integration - imobile/app-mediation GitHub Wiki

Integration

This page shows you how to download, configure, and initialize the AppLovin MAX SDK.

Download the latest SDK

※ Gradleを利用せずに手動でSDKを導入したい場合は弊社営業にご連絡ください。

Gradle (Recommended)

※ AppLovin MAXと共に配信するネットワークについては弊社担当営業よりご提案させていただきます。

// Repos
repositories {
    maven { url "https://android-sdk.is.com" }                              // ironSourceを利用しない場合は削除
    maven { url "https://imobile-maio.github.io/maven" }                    // maioを利用しない場合は削除
    maven { url "http://fan-adn.github.io/nendSDK-Android-lib/library" }    // nendを利用しない場合は削除
    maven { url "https://artifact.bytedance.com/repository/pangle" }        // Pangleを利用しない場合は削除
}

dependencies {
    implementation 'com.google.android.gms:play-services-location:18.0.0'
    implementation 'com.applovin:applovin-sdk:+'
    implementation 'com.applovin.mediation:google-adapter:+'               // AdMobを利用しない場合は削除
    implementation 'com.applovin.mediation:google-ad-manager-adapter:+'    // Ad Managerを利用しない場合は削除
    implementation 'com.applovin.mediation:ironsource-adapter:+'           // ironSourceを利用しない場合は削除
    implementation 'com.applovin.mediation:maio-adapter:+'                 // maioを利用しない場合は削除
    implementation 'com.applovin.mediation:nend-adapter:+'                 // nendを利用しない場合は削除
    implementation 'com.applovin.mediation:bytedance-adapter:+'            // Pangleを利用しない場合は削除
    implementation 'com.applovin.mediation:unityads-adapter:+'             // Unity Adsを利用しない場合は削除
}

Tip: If you want to receive release updates, subscribe to our GitHub repository.

Note: Amazon Fire OS is not supported at this time.

Add Your Google AdMob App ID

※ AdMobをご利用の場合は以下の設定を追加してください。

In your app’s AndroidManifest.xml , add a <meta-data> tag inside the <application> tag. In the example below, replace INSERT_YOUR_ADMOB_APP_ID_HERE with your AdMob App ID.

<?xml version="1.0" encoding="utf-8"?>
<manifest … >
    <application … >
        <meta-data
            android:name="com.google.android.gms.ads.APPLICATION_ID"
            android:value="INSERT_YOUR_ADMOB_APP_ID_HERE"/>
        ⋮
    </application>
</manifest>

Enable Google Ad Manager

※ Ad Managerをご利用の場合は以下の設定を追加してください。

In your app’s AndroidManifest.xml , add a <meta-data> tag inside the <application> tag, as in the example below:

<?xml version="1.0" encoding="utf-8"?>
<manifest … >
    <application … >
        <meta-data
              android:name="com.google.android.gms.ads.AD_MANAGER_APP"
              android:value="true"/>
        ⋮
    </application>
</manifest>

Add the SDK Key

Add the following <meta-data> element to your AndroidManifest.xml , inside the <application> element:

<meta-data android:name="applovin.sdk.key" android:value="※SDK keyを入力してください"/>

※ SDK keyにつきましては弊社営業からご連絡いたします。

Enable Ad Review

Related Content: “Build Superior User Experience with MAX’s Ad Review” from AppLovin’s Blog.

To enable the MAX Ad Review service, add the following to your build.gradle files:

Additions to Root-Level build.gradle File

buildscript {
    repositories {
        maven { url 'https://artifacts.applovin.com/android' }
    }
    dependencies {
        classpath "com.applovin.quality:AppLovinQualityServiceGradlePlugin:+"
    }
}

Additions to App-Level build.gradle File

apply plugin: 'applovin-quality-service'
applovin {
       apiKey "※ API keyを入力してください"    
}

※ API keyにつきましては弊社営業からご連絡いたします。

Initialize the SDK

Initialize the SDK by calling the initializeSdk() method, passing that method an Activity context. Do this as soon as possible after your app starts, for example in the onCreate() method of your launch Activity .

// Java

public class MainActivity extends Activity
{
    protected void onCreate(Bundle savedInstanceState)
    {
        // Please make sure to set the mediation provider value to "max" to ensure proper functionality
        AppLovinSdk.getInstance( this ).setMediationProvider( "max" );
        AppLovinSdk.initializeSdk( this, new AppLovinSdk.SdkInitializationListener() {
            @Override
            public void onSdkInitialized(final AppLovinSdkConfiguration configuration)
            {
                // AppLovin SDK is initialized, start loading ads
            }
        } );
    }
}
// Kotlin

class MainActivity : Activity()
{
    override fun onCreate(savedInstanceState: Bundle?)
    {
        // Please make sure to set the mediation provider value to "max" to ensure proper functionality
        AppLovinSdk.getInstance( this ).setMediationProvider( "max" )
        AppLovinSdk.getInstance( this ).initializeSdk({ configuration: AppLovinSdkConfiguration ->
            // AppLovin SDK is initialized, start loading ads
        })
    }
}
⚠️ **GitHub.com Fallback** ⚠️