AdMob in Android Instant Apps

Android Instant Apps enables Android apps to run instantly, without requiring installation. This guide is intended for publishers who want to monetize an Android Instant App with AdMob.

Prerequisites

  • Use Android Studio 3.0 Canary 1 or higher
  • Instant Apps Development SDK
  • Android SDK Platform O
  • Target Android API level 14 or higher

Import the Mobile Ads SDK

Android instant apps need to be structured into URL-addressable modules that are under 4MB in size. To help stay within this size constraint, it is recommended to use the Google Mobile Ads Lite SDK over the standard version. More information on the Lite SDK, including its limitations, can be found in the Lite SDK guide.

Apps can import the Google Mobile Ads Lite SDK with a gradle dependency. Open the app-level build.gradle file for your app, and look for a "dependencies" section.

dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    implementation 'androidx.appcompat:appcompat:1.2.0'
    implementation 'com.google.android.gms:play-services-ads-lite:23.0.0'
    ...
}

Add the line in bold above, which instructs gradle to pull in the latest version of the Mobile Ads Lite SDK. Once that's done, save the file and perform a Gradle sync.

The Lite SDK is distributed as part of the Google Repository, so you may see a message from Android Studio asking you to install it. If so, just agree to the download, and Android Studio will take care of the rest.

Next steps

The next steps to displaying AdMob ads and earning revenue is to Initialize Mobile Ads SDK and to Choose an ad format.

Mediation in Instant Apps

Google mediation is not officially supported when monetizing Android Instant apps with AdMob. Instant apps require all web content displayed to be loaded over secure connections. Ads from AdMob meet this requirement, but ads from third party ad networks may not. Therefore, we recommended you create a new ad unit that does not use mediation when monetizing an Android Instant app with AdMob.