Get Started with AppLovin SDK for Android and iOS

Author

Reads 507

Photo Of Woman Using Mobile Phone
Credit: pexels.com, Photo Of Woman Using Mobile Phone

Getting started with AppLovin SDK is a breeze. The first step is to integrate the SDK into your Android project by adding the following dependency to your build.gradle file: `implementation 'com.applovin.sdk:applovin-sdk:12.4.1'`.

To ensure seamless integration, make sure to add the necessary permissions to your AndroidManifest.xml file, such as `android.permission.INTERNET` and `android.permission.ACCESS_NETWORK_STATE`.

The AppLovin SDK supports both Android and iOS platforms, allowing you to reach a wider audience. To integrate the SDK on iOS, you'll need to add the AppLovin SDK framework to your project using CocoaPods or by manually adding the framework to your Xcode project.

By following these simple steps, you'll be well on your way to successfully integrating the AppLovin SDK into your app.

Getting Started

To get started with the AppLovin SDK, you need to have a basic understanding of how it works. The AppLovin SDK is a software development kit that allows you to integrate advertising into your mobile app.

Credit: youtube.com, INTEGRATE APPLOVIN ADS TO YOUR UNITY APP in 10 minutes.

First, you'll need to obtain an AppLovin account. This can be done by signing up on the AppLovin website. To do this, click on the "Sign Up" button and follow the prompts to create an account.

Once you have an account, you can start integrating the AppLovin SDK into your app. This involves adding the necessary code to your app's project, which can be found in the AppLovin documentation.

Demo App

To get started with the demo apps, you'll need to open your desired project in Android Studio, either the Java Demo App or the Kotlin Demo App. These sample projects demonstrate how to mediate ads using AppLovin MAX.

First, verify that the dependency implementation 'com.applovin:applovin-sdk:+' is included in your build.gradle (Module: app). This is a crucial step to ensure everything works smoothly.

Next, change the package with your own unique identifier in your build.gradle (Module: app). Base your unique identifier on the name of the application you will create or that you have already created in the MAX dashboard.

Explore further: Applovin Max Sdk

Credit: youtube.com, GoDial - Getting Started Demo

Update the unique MAX ad unit ID value within the activity code for each ad format. Each ad format corresponds to a unique MAX ad unit ID you create in the AppLovin dashboard for the package used before.

Here are the ad formats available in the demo apps:

Initialize the

To initialize the AppLovin SDK, you'll need to create an initialization configuration object. This object allows you to configure the properties that the SDK will initialize with.

You can find your SDK key in the Account > General > Keys section of the AppLovin dashboard. This is where you'll get the key you need to initialize the SDK correctly.

The SDK initialization configuration object is immutable, except for AppLovinSdkSettings, which contains mutable properties that can be changed during the app's lifetime. This is useful for making adjustments as needed.

Initialize the AppLovin SDK with the initialization configuration object as early as possible, such as in the onCreate() of the launch activity or Application class. This maximizes the time the SDK has to cache mediated networks' ads, resulting in a better user experience.

You can also initialize the SDK on the main home screen of your app. This is especially important for video ads, as it gives mediated networks the maximum amount of time to cache ads.

Setup and Configuration

Credit: youtube.com, APPLOVIN ADS TO UNITY INTEGRATION TUTORIAL EASY **HOW TO MONETIZE GAME WITH APPLOVIN/MAX SDK**

To set up the AppLovin SDK, you'll need to find your SDK key in the Account > General > Keys section of the AppLovin dashboard.

You can 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, resulting in a better user experience.

Proguard Rules

If you use ProGuard, don't worry about adding extra rules to your project, as the AppLovin MAX SDK and adapters come bundled with the required ProGuard rules in the AARs.

You can simply rely on the built-in rules to ensure a smooth integration with ProGuard.

ProGuard rules are crucial for protecting your app's code, and having them pre-configured can save you a lot of time and effort.

App-Level build.gradle Additions

To add the necessary code to your App-Level build.gradle file, you'll need to find your Ad Review Key in the AppLovin dashboard. This can be done by navigating to the Account > General > Keys section of the dashboard.

Engineer Developing App
Credit: pexels.com, Engineer Developing App

You'll also want to ensure you're using the correct version of the AppLovin adapter for bidding. According to the requirements, you should be using version 9.4.2.0 or higher.

Here are the specific requirements for AppLovin integration:

Remember, no additional code is required for AppLovin integration, so you can skip that step.

Set Up Configurations

To set up configurations for your AppLovin SDK, you'll need to find your SDK key in the Account > General > Keys section of the AppLovin dashboard. This key is required for initialization and can be found in various sections, including Examples 1, 2, 3, 7, and 8.

You'll also need to register your test device for AdMob and enable test mode in AppLovin UI, as mentioned in Examples 4 and 14. This is crucial for testing your ad configurations.

The AppLovin UI offers a configuration section where you can set up your AdMob ad unit, requiring your AppLovin SDK Key and Report Key. This can be done in the Account > Keys section of the AppLovin UI, as shown in Examples 2 and 6.

Close-up of a cappuccino and smartphone displaying app interface on a table.
Credit: pexels.com, Close-up of a cappuccino and smartphone displaying app interface on a table.

To configure mediation settings for your ad unit, select the Google Mobile Ads AppLovin Mediation package and click Install, as described in Example 11.

Here's a quick rundown of the required configurations:

Remember, the AppLovin SDK Key is immutable, except for the AppLovinSdkSettings, which contains mutable properties that can be changed during the app's lifetime. This is mentioned in Example 1.

Integration

Integration with AppLovin SDK is a straightforward process. There are multiple ways to integrate the SDK, including using the mediation adapter for AdMob.

To integrate the AppLovin SDK, you can use the mediation adapter for AdMob, which supports bidding and waterfall integrations. However, bidding doesn't support banner ads, so you'll need to consider this when planning your ad strategy.

You can also integrate the AppLovin SDK manually by downloading the Android SDK and adding it to your project. This process involves downloading the AppLovin adapter's .aar file from Google's Maven Repository and adding it to your project.

Here are the supported integrations and ad formats for the AppLovin SDK:

No additional code is required for AppLovin integration, making it a hassle-free process.

Android Studio Integration

Credit: youtube.com, Android Studio Integration

To integrate AppLovin into your Android app using Android Studio, you'll want to add the necessary dependencies and configurations to your app-level build.gradle.kts file. This is the recommended method for integration.

You'll need to add the implementation dependencies for the AppLovin SDK and adapter. Be sure to use the latest versions available. This will ensure you have the most up-to-date features and security patches.

Here are the specific implementation dependencies you'll need to add:

No additional code is required for AppLovin integration once you've added these dependencies. Simply sync your project with the changes, and you're ready to go.

Integrate Custom Adapters

To integrate custom adapters, start by navigating to the AppLovin adapter artifacts on Google's Maven Repository. Select the latest version, download the AppLovin adapter's .aar file, and add it to your project.

AppLovin Exchange (ALX) supports a custom adapter for LinkedIn, which you can use to integrate LinkedIn ads into your app. To install the adapter, follow the instructions on the AppLovin website.

For Android or iOS, you can download the adapter from the AppLovin website and add it to your project. No additional code is required for AppLovin integration.

Integrations and Ad Formats

Free stock photo of amc, app, app interface
Credit: pexels.com, Free stock photo of amc, app, app interface

AppLovin and AdMob mediation adapters for AppLovin support various integrations and ad formats.

The mediation adapter for AppLovin supports bidding, but it doesn't support banner ads. Waterfall, another integration supported by the adapter, only supports 320x50 and 728x90 banner sizes.

The AdMob mediation adapter for AppLovin also supports bidding and waterfall integrations, but like the AppLovin mediation adapter, it doesn't support banner ads.

Bidding and waterfall integrations are supported by both mediation adapters, but they don't support banner ads.

Here are the supported ad formats for both mediation adapters:

The Java/Kotlin demo apps also support various ad formats, including App Open, Banner, Interstitial, MREC, Native, and Rewarded.

Implementation

Implementation is a crucial step in working with the AppLovin SDK. You'll need to test your implementation to ensure everything is working as expected.

To test your implementation, you'll need to use the Google Mobile Ads SDK version 21.0.0 and the AppLovin SDK version 11.4.4. These versions are specifically mentioned in the testing phase of the implementation process.

Here's a list of the required SDK versions for testing:

  • Google Mobile Ads SDK version 21.0.0.
  • AppLovin SDK version 11.4.4.

By using these specific versions, you can ensure that your implementation is compatible with the latest requirements and features of the AppLovin SDK.

Testing

Credit: youtube.com, Android Studio + Heyzap Mediation With Applovin

Testing is a crucial step in setting up the Applovin SDK. Make sure you register your test device for AdMob.

To test ads, you need to enable test mode in Applovin UI. This will allow you to verify that test ads are being received.

Verify that you are receiving test ads from Applovin by enabling single ad source testing in ad inspector using the Applovin (Bidding) and Applovin (Waterfall) ad source(s). This will ensure that you're seeing test ads instead of live ones.

Registering your test device is a one-time process that will help you test ads without affecting your live app performance.

Ad Formats and Mediation

The AppLovin SDK offers a variety of ad formats that can be implemented in your app.

The Java/Kotlin demo apps showcase examples of implementing the following ad formats: App Open, Banner, Interstitial, MREC, Native, and Rewarded ads.

To configure mediation settings for your ad unit, select the Google Mobile Ads AppLovin Mediation package and click Install.

Here's a list of ad formats supported by the AppLovin mediation adapter for AdMob:

Waterfall supports only 320x50 and 728x90 banner sizes, and bidding doesn't support banner ads.

Demo Ad Formats

Credit: youtube.com, AdSupply Ad Network | Leave-Behind Ad Format | High-Impact Advertising Demo

The demo ad formats for Java and Kotlin are quite impressive. Java and Kotlin demo apps have examples of implementing the following ad formats.

App Open, Banner, Interstitial, MREC, Native, and Rewarded ad formats are all supported in Java and Kotlin.

The AppLovin mediation adapter supports bidding and waterfall integrations, as well as banner, interstitial, rewarded, and native ad formats. However, bidding doesn't support banner ads, and waterfall only supports 320x50 and 728x90 banner sizes.

Here are the ad formats supported by the Java and Kotlin demo apps:

Set up ad unit mediation

To verify test ads from AppLovin, enable single ad source testing in ad inspector using the AppLovin (Bidding) and AppLovin (Waterfall) ad source(s).

You'll need to configure mediation settings for your ad unit by selecting the Google Mobile Ads AppLovin Mediation package and clicking Install.

No additional code is required for AppLovin integration, so you can skip that step.

Version History

AppLovin SDK has been constantly evolving to meet the changing needs of mobile app developers.

Credit: youtube.com, Applovin Auto Self Click new sdk update app working system

The first version of AppLovin SDK was released in 2012, allowing developers to monetize their apps with display ads.

AppLovin SDK 2.0 was released in 2015, introducing a new mediation platform that enabled developers to connect with multiple ad networks.

This version also introduced a new ad format, rewarded videos, which gave users a way to earn rewards by watching ads.

AppLovin SDK 3.0 was released in 2017, featuring a new ad format, playable ads, which allowed developers to create interactive ad experiences.

AppLovin SDK 4.0 was released in 2020, introducing a new feature, dynamic ad insertion, which enabled developers to dynamically insert ads into their video content.

This version also improved the overall performance and stability of the SDK.

Troubleshooting

Troubleshooting can be a real pain, but don't worry, I've got your back. If the AppLovin adapter fails to receive an ad, you can check the underlying error from the ad response using ResponseInfo.

Credit: youtube.com, Resolving CocoaPods Compatibility Issues with UnityAds and AppLovin Mediation

If you see error codes in the range of -1009 to -1, 204, it means the AppLovin SDK returned an error, so be sure to check AppLovin's documentation for more details.

The requested ad size might not match an AppLovin supported banner size, which is error code 101.

Context is null, which is error code 103, can cause issues too.

If the AppLovin bid token is empty, you'll get error code 104.

Requested multiple ads for the same zone? That's error code 104 too, as AppLovin can only load 1 ad at a time per zone.

Ad is not ready to display? That's error code 106.

If the AppLovin Adapter does not support the ad format being requested, you'll get error code 108.

Context is not an Activity instance? That's error code 109.

Invalid server parameters? That's error code 110.

And, sadly, if the user is a child, you'll get error code 112.

Here are the error codes and reasons for reference:

Credit: youtube.com, How to Use GDPR Consent in Advertising Networks Like AdMob, Vungle, IronSource, and AppLovin

To comply with the EU's GDPR and ePrivacy Directive, you must obtain user consent for the use of cookies or other local storage in the European Economic Area (EEA), the UK, and Switzerland. This means making certain disclosures to your users and obtaining their consent for the collection, sharing, and use of personal data for ads personalization.

You can use the AppLovinMAX.hasUserConsent() method to check if the user has given consent, which returns a boolean value. You can also use the AppLovin.MAX.SetHasUserConsent() method to set the consent status, which must be done before initializing the Google Mobile Ads SDK.

Here are the methods you can use to interact with the AppLovin SDK's consent and data APIs:

Update Your App-Ads.Txt

Updating your app-ads.txt file is a crucial step in ensuring your app ad inventory is only sold through authorized channels.

Authorized Sellers for Apps app-ads.txt is an IAB Tech Lab initiative that helps prevent a significant loss in ad revenue.

To implement app-ads.txt, set up an app-ads.txt file for your app if you haven't already.

You'll need to add AppLovin to your app-ads.txt file if you're using their services.

For instructions on how to do this, see step 2 in the guide for Android.

Credit: youtube.com, Technical Overview for Implicit Consent for Purposes

To obtain consent from users in certain jurisdictions on behalf of AppLovin's monetization partners, you must correctly pass consent values to AppLovin. Review the Privacy–Consent, Age-Related Flags, and Data APIs documentation for more information.

You can use the AppLovinMAX.getAdaptiveBannerHeightForWidth(width) method to get the height of an ad banner, but you'll need to obtain consent first. The AppLovinMAX.hasUserConsent() method returns a boolean value indicating whether the user has given consent.

To set up configurations in AppLovin UI, you'll need your AppLovin SDK Key and Report Key. You can find these values in the AppLovin UI > Account > Keys.

The AppLovin adapter version 13.0.0.1 or higher disables AppLovin mediation automatically for apps that declare certain settings with the Google Mobile Ads SDK.

To comply with Google EU User Consent Policy, you must make certain disclosures to your users in the European Economic Area (EEA), the UK, and Switzerland, and obtain their consent for the use of cookies or other local storage where legally required.

Credit: youtube.com, Data Privacy and Consent | Fred Cate | TEDxIndianaUniversity

Here are some methods you can use to pass consent information to the AppLovin SDK:

If you're using AppLovin version 7.0.0 or higher, you can use the Google Mobile Ads mediation plugin to automatically pass the user's consent choice to AppLovin. However, if you're not using this plugin, you'll need to use the AppLovinMAX.SetHasUserConsent() and AppLovinMAX.SetIsAgeRestrictedUser() methods to pass consent information manually.

Modules

In AppLovin SDK, the architecture has undergone a significant change with the introduction of modules in version 6. This change is a result of the need to categorize various functions into separate modules.

The AppLovinMAX module is the default module and is responsible for integration, including initialization and general-purpose functions.

A new set of modules has been introduced in version 6, each catering to specific types of ads and functionalities.

Here's a list of the major new modules:

These modules have replaced the single AppLovinMAX module that was used in previous versions, providing a more organized and efficient way to manage different types of ads and functionalities.

Frequently Asked Questions

What is SDK used for?

An SDK (Software Development Kit) is a collection of tools that helps developers build and run software on specific platforms, operating systems, or programming languages. It provides everything needed to create, test, and deploy software in one place.

Katrina Sanford

Writer

Katrina Sanford is a seasoned writer with a knack for crafting compelling content on a wide range of topics. Her expertise spans the realm of important issues, where she delves into thought-provoking subjects that resonate with readers. Her ability to distill complex concepts into engaging narratives has earned her a reputation as a versatile and reliable writer.

Love What You Read? Stay Updated!

Join our community for insights, tips, and more.