AdMob в приложениях с мгновенным запуском для Android
Оптимизируйте свои подборки
Сохраняйте и классифицируйте контент в соответствии со своими настройками.
Функция Android Instant Apps позволяет запускать приложения Android мгновенно, без необходимости установки. Это руководство предназначено для издателей, желающих монетизировать приложения Android Instant App с помощью AdMob.
Предпосылки
- Используйте Android Studio 3.0 Canary 1 или выше.
- SDK для мгновенной разработки приложений
- Android SDK Платформа O
- Целевой уровень Android API 14 или выше
Импортируйте Mobile Ads SDK
Приложения Android с мгновенным запуском должны быть структурированы в URL-адресуемые модули размером менее 4 МБ. Чтобы не выходить за рамки этого ограничения, рекомендуется использовать Google Mobile Ads Lite SDK вместо стандартной версии. Подробнее о Lite SDK, включая его ограничения, можно узнать в руководстве по Lite SDK .
Приложения могут импортировать Google Mobile Ads Lite SDK с помощью зависимости Gradle. Откройте файл build.gradle на уровне приложения и найдите раздел «Dependencies».
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'androidx.appcompat:appcompat:1.2.0'
implementation 'com.google.android.gms:play-services-ads-lite:24.5.0'
...
}
Добавьте строку, выделенную жирным шрифтом выше, которая указывает Gradle загрузить последнюю версию Mobile Ads Lite SDK. После этого сохраните файл и выполните синхронизацию с Gradle.
Lite SDK распространяется как часть репозитория Google, поэтому вы можете увидеть сообщение от Android Studio с предложением установить его. В этом случае просто согласитесь на загрузку, и Android Studio позаботится обо всём остальном.
Следующие шаги
Следующим шагом для показа рекламы AdMob и получения дохода является инициализация Mobile Ads SDK и выбор формата рекламы .
Медиация Google официально не поддерживается при монетизации приложений Android Instant через AdMob. Для приложений Android Instant требуется, чтобы весь отображаемый веб-контент загружался через защищённые соединения. Реклама AdMob соответствует этому требованию, но реклама сторонних рекламных сетей может не соответствовать. Поэтому мы рекомендуем вам создать новый рекламный блок без использования медиации при монетизации приложения Android Instant через AdMob.
Если не указано иное, контент на этой странице предоставляется по лицензии Creative Commons "С указанием авторства 4.0", а примеры кода – по лицензии Apache 2.0. Подробнее об этом написано в правилах сайта. Java – это зарегистрированный товарный знак корпорации Oracle и ее аффилированных лиц.
Последнее обновление: 2025-09-03 UTC.
[[["Прост для понимания","easyToUnderstand","thumb-up"],["Помог мне решить мою проблему","solvedMyProblem","thumb-up"],["Другое","otherUp","thumb-up"]],[["Отсутствует нужная мне информация","missingTheInformationINeed","thumb-down"],["Слишком сложен/слишком много шагов","tooComplicatedTooManySteps","thumb-down"],["Устарел","outOfDate","thumb-down"],["Проблема с переводом текста","translationIssue","thumb-down"],["Проблемы образцов/кода","samplesCodeIssue","thumb-down"],["Другое","otherDown","thumb-down"]],["Последнее обновление: 2025-09-03 UTC."],[[["\u003cp\u003eAndroid Instant Apps allow Android apps to run instantly without installation, and this guide focuses on monetizing them with AdMob.\u003c/p\u003e\n"],["\u003cp\u003eDevelopers need to use Android Studio 3.0 Canary 1 or higher, Instant Apps Development SDK, Android SDK Platform O, and target Android API level 14 or higher as prerequisites.\u003c/p\u003e\n"],["\u003cp\u003eIt's recommended to integrate the Google Mobile Ads Lite SDK for optimal size management within Instant Apps, and instructions for adding it via Gradle are provided.\u003c/p\u003e\n"],["\u003cp\u003eMediation with third-party ad networks isn't officially supported in Instant Apps due to security requirements for web content.\u003c/p\u003e\n"]]],["Android Instant Apps run without installation, and this guide focuses on monetizing them with AdMob. Publishers must use Android Studio 3.0+, the Instant Apps Development SDK, and target API level 14+. Due to size constraints (under 4MB), the Google Mobile Ads Lite SDK is recommended, imported via Gradle dependency in the `build.gradle` file. Initialize the Mobile Ads SDK and choose an ad format to display ads. Google mediation is not supported in instant apps.\n"],null,["[Android Instant Apps](//developer.android.com/topic/instant-apps/)\nenables Android apps to run instantly, without requiring\ninstallation. This guide is intended for publishers who want to monetize an\nAndroid Instant App with AdMob.\n\nPrerequisites\n\n- Use Android Studio 3.0 Canary 1 or higher\n- Instant Apps Development SDK\n- Android SDK Platform O\n- Target Android API level 14 or higher\n\nImport the Mobile Ads SDK\n\nAndroid instant apps need to be structured into URL-addressable modules that\nare under 4MB in size. To help stay within this size constraint, it is\nrecommended to use the Google Mobile Ads Lite SDK over the standard version.\nMore information on the Lite SDK, including its limitations, can be found in\nthe [Lite SDK guide](/admob/android/lite-sdk).\n\nApps can import the Google Mobile Ads Lite SDK with a gradle dependency. Open\nthe app-level build.gradle file for your app, and look for a \"dependencies\"\nsection. \n\n dependencies {\n implementation fileTree(dir: 'libs', include: ['*.jar'])\n implementation 'androidx.appcompat:appcompat:1.2.0'\n implementation 'com.google.android.gms:play-services-ads-lite:24.5.0'\n ...\n }\n\nAdd the line in bold above, which instructs gradle to pull in the latest\nversion of the Mobile Ads Lite SDK. Once that's done, save the file and perform\na Gradle sync.\n\nThe Lite SDK is distributed as part of the Google Repository, so you may see a\nmessage from Android Studio asking you to install it. If so, just agree to the\ndownload, and Android Studio will take care of the rest.\n\nNext steps\n\nThe next steps to displaying AdMob ads and earning revenue is to [Initialize\nMobile Ads SDK](/admob/android/quick-start#initialize_mobile_ads)\nand to [Choose an ad format](/admob/android/quick-start#choose_an_ad_format).\n\nMediation in Instant Apps\n\nGoogle mediation is not officially supported when monetizing Android Instant\napps with AdMob. Instant apps require all web content displayed to be loaded\nover secure connections. Ads from AdMob meet this requirement, but ads from\nthird party ad networks may not. Therefore, we recommended you create a new ad\nunit that does not use mediation when monetizing an Android Instant app with\nAdMob."]]