Skip to content
On this page

AppLovin Custom Adapter

Android Ads SDK supports integration with the AppLovin MAX monetization platform. Currently, the following ad formats are integrated:

  • Banner Ads

AppLovin SDK Integration

Adapter version:

Demo: applovin-demo-app

Stable release: solutionarchitectstech:applovin_adapter

Requirements

  • Kotlin version >= 1.6.20
  • Android 5.0+ (API Level >= 21)

Follow the steps described in the AppLovin SDK Integration documentation.

Custom Network Adapter Integration

  1. Add the following configuration settings to your app-level build.gradle file:
groovy
repositories {
    google()
    mavenCentral()
    maven { url 'https://jitpack.io' }
}
dependencies {
    implementation 'com.applovin:applovin-sdk:+'
    implementation 'com.github.solutionarchitectstech:applovin-sa-network-adapter:{{ version }}'
}
  1. Provide init configuration for Android Ads SDK before AppLovin`s initialization:
kotlin
class YourApplication : Application() {

    override fun onCreate() {
        super.onCreate()

        AppLovinSdk.getInstance(applicationContext).mediationProvider = "max"
        AppLovinSdk.getInstance(applicationContext).provideSolutionArchitectsInitConfig(
            storeUrl = "YOUR_STORE_URL",
            sessionId = "YOUR_SESSION_ID",
            debugMode = true,
            headers = mapOf("Authorization" to { "Bearer YOUR_TOKEN" }),
            bannerUrl = "https://YOUR_BANNER_ENDPOINT"
        )
        AppLovinSdk.getInstance(applicationContext).initializeSdk()
    }
}
  1. Also you can provide additional parameters for each ad unit:
kotlin
private fun createBannerAd() {
    adView = MaxAdView("YOUR_AD_UNIT_ID", this)
    adView?.setListener(this)
    adView?.provideSolutionArchitectsBannerParams(
        closeButtonType = CloseButtonType.Countdown(
            3000
        ), floorPrice = 3.21, currency = "RUB"
    )

    // Stretch to the width of the screen for banners to be fully functional
    val width = resources.getDimensionPixelSize(R.dimen.banner_width)

    // Banner height on phones and tablets is 50 and 90, respectively
    val heightPx = resources.getDimensionPixelSize(R.dimen.banner_height)

    adView?.layoutParams = FrameLayout.LayoutParams(width, heightPx)

    // Set background or background color for banners to be fully functional
    adView?.setBackgroundColor(Color.BLACK)

    val rootView = findViewById<ViewGroup>(R.id.root)
    rootView.addView(adView)

    // Load the ad
    adView?.loadAd()
}

Learn how to identify users in banner requests User ID (UID)

Custom SDK Network configuration

Add Custom SDK Network Settings

Follow steps from official documentation Applovin Max

  1. In the MAX Dashboard select MAX > Mediation > Manage > Networks.
  2. Then click Click here to add a Custom Network at the bottom of the page. The Create Custom Network page appears. Add the information about your custom network:
    • Network Type - choose SDK.
    • Name - type the desired name of your custom network.
    • Android Adapter Class Name - put the following string com.applovin.mediation.adapters.SolutionArchitectsMediationAdapter

Enable network in your MAX Account

  1. Select the MAX ad unit placement on which you want to enable the custom network.
  2. Find section Custom Networks & Deals and unfold your network item.
  3. Enable custom network by click on the Status toggle.
  4. Set required parameter Placement ID.
  5. Set optional paraeters App ID and Custom Parameters if you need. Custom Parameters field should have the following format:
json
{"floorPrice":1.234,"currency":"RUB","exampleParam":"exampleValue"}
  1. Set CPM price.
  2. Select geo trageting in Country Targeting field.

Applovin Console