AdMob 웹 인터페이스에서 확인한 AdMob 앱 ID를 앱의 AndroidManifest.xml 파일에 추가합니다. 이렇게 하려면 android:name="com.google.android.gms.ads.APPLICATION_ID"가 있는 <meta-data>
태그를 추가합니다. AdMob 웹 인터페이스에서 앱 ID를 확인할 수 있습니다. android:value의
경우 내 AdMob 앱 ID를 따옴표로 묶어
입력하세요.
SAMPLE_APP_ID를 AdMob 앱 ID로 바꿉니다. 테스트하는 동안 이전 예시에 표시된 샘플 앱 ID를 사용하세요.
또한 <meta-data> 태그를 위와 정확히 동일하게 추가하지 않으면 아래 메시지가 표시되며 앱이 다운됩니다.
Missing application ID.
(선택사항) 이전 버전이 Android 13에서 작동하도록
AD_ID 권한을 선언하세요.
앱에서 Google 모바일 광고 SDK 버전 20.4.0 이상을 사용하는 경우, SDK가 com.google.android.gms.permission.AD_ID 권한을 자동으로 선언하고
가능할 때마다 광고 ID에 액세스할 수 있으므로 이 단계를 건너뛰어도 됩니다.
Google 모바일 광고 SDK 버전 20.3.0 이하를 사용하고 Android 13을 타겟팅하는 앱의 경우 Google 모바일 광고 SDK가 광고 ID에 액세스할 수 있도록 AndroidManifest.xml 파일에 com.google.android.gms.permission.AD_ID 권한을 추가해야 합니다.
이 메서드는 SDK를 초기화하고 Google 모바일 광고 SDK와 어댑터 초기화가 모두 완료되거나 30초의 제한 시간이 경과하면 완료 리스너를 호출합니다. 이 작업은 한 번만 처리하면 되며, 앱 실행 시 처리하는 것이 좋습니다.
초기화하면 Google 모바일 광고 SDK 또는 미디에이션 파트너 SDK에서 광고를 미리 로드할 수도 있습니다. 유럽 경제 지역(EEA) 사용자의
동의를 얻어야 하는 경우 요청별 플래그(예: setTagForChildDirectedTreatment() 또는 setTagForUnderAgeOfConsent())를
설정하거나 광고를 로드하기
전에 조치를 취합니다. 이 작업은 Google 모바일 광고 SDK를 초기화하기 전에
이루어져야 합니다.
다음은 활동 내 백그라운드 스레드에서 initialize() 메서드를 호출하는 방법의 예입니다.
자바
newThread(()->{// Initialize the Google Mobile Ads SDK on a background thread.MobileAds.initialize(this,initializationStatus->{});}).start();
[null,null,["최종 업데이트: 2025-08-31(UTC)"],[[["\u003cp\u003eIntegrating the Google Mobile Ads SDK is the initial step to display ads in your app and generate revenue, followed by choosing an ad format (like native or rewarded video) and implementing it.\u003c/p\u003e\n"],["\u003cp\u003eBefore starting, ensure your app has a minimum SDK version of 21, a compile SDK version of 33 or higher, and is registered with AdMob to obtain a unique AdMob App ID.\u003c/p\u003e\n"],["\u003cp\u003eConfigure your app by including Google's and Maven Central's repositories, adding the Google Mobile Ads SDK dependency, and inserting your AdMob App ID in your \u003ccode\u003eAndroidManifest.xml\u003c/code\u003e file.\u003c/p\u003e\n"],["\u003cp\u003eInitialize the Google Mobile Ads SDK before loading ads by calling \u003ccode\u003eMobileAds.initialize()\u003c/code\u003e once, preferably during app launch, to ensure all mediation adapters are initialized.\u003c/p\u003e\n"],["\u003cp\u003eChoose from various ad formats offered by AdMob, including banner, interstitial, native, rewarded, rewarded interstitial, and app open ads, to best suit your app's user experience.\u003c/p\u003e\n"]]],["To start displaying ads, integrate the Google Mobile Ads SDK into your app. Ensure your app's minimum SDK version is 21 or higher, and compile SDK is 34 or higher. Register your app in AdMob to get a unique App ID. Configure your app by including Google's Maven and Maven central repositories, adding SDK dependencies in the build file, and inserting your AdMob app ID into `AndroidManifest.xml`. Initialize the SDK with `MobileAds.initialize()` on app launch, preferably on a background thread. Choose an ad format (banner, interstitial, native, rewarded, rewarded interstitial, or app open) to implement.\n"],null,["# Get Started\n\nSelect platform: [Android](/admob/android/quick-start \"View this page for the Android platform docs.\") [iOS](/admob/ios/quick-start \"View this page for the iOS platform docs.\") [Unity](/admob/unity/quick-start \"View this page for the Unity platform docs.\") [Flutter](/admob/flutter/quick-start \"View this page for the Flutter platform docs.\")\n\n\u003cbr /\u003e\n\nIntegrating\n\nGoogle Mobile Ads SDK\n\ninto an app is the first step toward displaying ads\nand earning revenue. Once you've integrated the SDK, you can choose an ad\nformat (such as native or rewarded video) and follow the steps to implement it.\n\nBefore you begin\n----------------\n\nTo prepare your app, complete the steps in the following sections.\n\n### App prerequisites\n\n- Make sure that your app's build file uses the following values:\n\n - Minimum SDK version of `23` or higher\n - Compile SDK version of `34` or higher\n\n### Set up your app in your AdMob account\n\nRegister your app as an AdMob app by completing the following steps:\n\n1. [Sign in to](//admob.google.com/home/) or [sign up\n for](//support.google.com/admob/answer/7356219) an AdMob account.\n\n2. [Register your app with AdMob](//support.google.com/admob/answer/2773509).\n This step creates an AdMob app with a unique [AdMob App\n ID](//support.google.com/admob/answer/7356431) that is needed later in this\n guide.\n\nConfigure your app\n------------------\n\n1. In your Gradle settings file, include the\n [Google's Maven repository](//maven.google.com/web/index.html) and\n [Maven central repository](//search.maven.org/artifact):\n\n ### Kotlin\n\n ```kotlin\n pluginManagement {\n repositories {\n google()\n mavenCentral()\n gradlePluginPortal()\n }\n }\n\n dependencyResolutionManagement {\n repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)\n repositories {\n google()\n mavenCentral()\n }\n }\n\n rootProject.name = \"My Application\"\n include(\":app\")\n ```\n\n ### Groovy\n\n ```groovy\n pluginManagement {\n repositories {\n google()\n mavenCentral()\n gradlePluginPortal()\n }\n }\n\n dependencyResolutionManagement {\n repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)\n repositories {\n google()\n mavenCentral()\n }\n }\n\n rootProject.name = \"My Application\"\n include ':app'\n ```\n2. Add the dependencies for\n\n Google Mobile Ads SDK\n\n to your app-level build file:\n\n ### Kotlin\n\n ```kotlin\n dependencies {\n implementation(\"com.google.android.gms:play-services-ads:24.5.0\")\n }\n ```\n\n ### Groovy\n\n ```groovy\n dependencies {\n implementation 'com.google.android.gms:play-services-ads:24.5.0'\n }\n ```\n3. Click **Sync Now** . For details on syncing, see\n [Sync projects with Gradle files](https://developers.android.com/build#sync-files).\n\n4. Add your AdMob app ID, as\n [identified in the AdMob web interface](//support.google.com/admob/answer/7356431),\n to your app's `AndroidManifest.xml` file. To do so, add a `\u003cmeta-data\u003e` tag\n with `android:name=\"com.google.android.gms.ads.APPLICATION_ID\"`. You can find\n your **app ID** in the AdMob web interface. For\n `android:value`, insert your own AdMob app ID,\n surrounded by quotation marks.\n\n \u003cmanifest\u003e\n \u003capplication\u003e\n \\\u003c!-- Sample AdMob app ID: ca-app-pub-3940256099942544\\~3347511713 --\\\u003e\n \\\u003cmeta-data\n android:name=\"com.google.android.gms.ads.APPLICATION_ID\"\n android:value=\"\u003cvar class=\"readonly\" translate=\"no\"\u003eSAMPLE_APP_ID\u003c/var\u003e\"/\\\u003e\n \u003c/application\u003e\n \u003c/manifest\u003e\n\n Replace \u003cvar class=\"readonly\" translate=\"no\"\u003eSAMPLE_APP_ID\u003c/var\u003e with your AdMob app ID. While\n testing, use the sample app ID shown in the previous example.\n\n Also, note that failure to add the `\u003cmeta-data\u003e` tag exactly as shown results\n in a crash with the message: \n\n Missing application ID.\n\n #### (Optional) Declare\n `AD_ID` permission for previous versions to work with Android\n 13.\n\n If your app uses\n\n Google Mobile Ads SDK\n\n version **20.4.0** or\n higher, you can skip this step since the SDK automatically declares the\n `com.google.android.gms.permission.AD_ID` permission and is able\n to access the Advertising ID whenever it's available.\n\n For apps that use\n\n Google Mobile Ads SDK\n\n version **20.3.0** or\n lower and are targeting Android 13, you must add the\n `com.google.android.gms.permission.AD_ID` permission in the\n `AndroidManifest.xml` file for\n\n Google Mobile Ads SDK\n\n to access the\n Advertising ID: \n\n ```xml\n \u003cmanifest\u003e\n \u003capplication\u003e\n \u003cmeta-data\n android:name=\"com.google.android.gms.ads.APPLICATION_ID\"\n android:value=\"ca-app-pub-xxxxxxxxxxxxxxxx~yyyyyyyyyy\"/\u003e\n\n \u003c!-- For apps targeting Android 13 or higher & GMA SDK version 20.3.0 or lower --\u003e\n \u003cuses-permission android:name=\"com.google.android.gms.permission.AD_ID\"/\u003e\n\n \u003c/application\u003e\n \u003c/manifest\u003e\n ```\n\n To learn more about the\n `com.google.android.gms.permission.AD_ID` permission declaration,\n including how to disable it, refer to this [Play\n Console article](//support.google.com/googleplay/android-developer/answer/6048248).\n\nInitialize the\nGoogle Mobile Ads SDK\n------------------------------------\n\nBefore loading ads, initialize Google Mobile Ads SDK by calling [`MobileAds.initialize()`](/admob/android/reference/com/google/android/gms/ads/MobileAds#initialize(android.content.Context,%20com.google.android.gms.ads.initialization.OnInitializationCompleteListener)).\n\nThis method initializes the SDK and calls a completion listener once both\n\n\nGoogle Mobile Ads SDK\n\nand adapter initializations have completed, or after a\n30-second timeout. This needs to be done only once, ideally at app launch.\n| **Note:** If you're using AdMob Mediation, wait until the completion handler is called before loading ads. This ensures that all mediation adapters are initialized.\n\n**Ads may be preloaded by\nGoogle Mobile Ads SDK\nor mediation partner SDKs\nupon initialization.** If you need to obtain consent from users in the European\nEconomic Area (EEA), set any request-specific flags, such as\n\n[`setTagForChildDirectedTreatment()`](/admob/android/reference/com/google/android/gms/ads/RequestConfiguration.Builder#setTagForChildDirectedTreatment(int))\nor\n[`setTagForUnderAgeOfConsent()`](/admob/android/reference/com/google/android/gms/ads/RequestConfiguration.Builder#setTagForUnderAgeOfConsent(int)),\n\nor\notherwise take action before loading ads, ensure you do so before initializing\n\n\nGoogle Mobile Ads SDK\n\n.\n\nHere's an example of how to call the `initialize()` method on a background\nthread within an Activity: \n\n### Java\n\n new Thread(\n () -\u003e {\n // Initialize the Google Mobile Ads SDK on a background thread.\n MobileAds.initialize(this, initializationStatus -\u003e {});\n })\n .start(); \n https://github.com/googleads/googleads-mobile-android-examples/blob/ccc290a583d7f552bdcf81ea76adc05beaa43f0b/java/admob/BannerExample/app/src/main/java/com/google/android/gms/example/bannerexample/MyActivity.java#L195-L204\n\n### Kotlin\n\n CoroutineScope(Dispatchers.IO).launch {\n // Initialize the Google Mobile Ads SDK on a background thread.\n MobileAds.initialize(this@MainActivity) {}\n } \n https://github.com/googleads/googleads-mobile-android-examples/blob/ccc290a583d7f552bdcf81ea76adc05beaa43f0b/kotlin/admob/BannerExample/app/src/main/java/com/google/android/gms/example/bannerexample/MainActivity.kt#L167-L176\n\nSelect an ad format\n-------------------\n\n\nGoogle Mobile Ads SDK\n\nis now imported and you're ready to implement an ad.\nAdMob offers a number of different ad formats, so\nyou can choose the one that best fits your app's user experience.\n\n### Banner\n\nBanner ad units display rectangular ads that occupy a portion of an app's\nlayout. They can refresh automatically after a set period of time. This means\nusers view a new ad at regular intervals, even if they stay on the same\nscreen in your app. They're also the simplest ad format to implement. \n\n[Implement banner ads](/admob/android/banner)\n\n### Interstitial\n\nInterstitial ad units show full-page ads in your app. Place them at natural\nbreaks and transitions in your app's interface, such as after level completion\nin a gaming app. \n\n[Implement interstitial ads](/admob/android/interstitial)\n\n### Native\n\nNative ads are ads where you can customize the way assets such as headlines and\ncalls to action are presented in your apps. By styling the ad yourself, you can\ncreate a natural, unobtrusive ad presentations that can add to a rich user\nexperience. \n\n[Implement native ads](/admob/android/native)\n\n### Rewarded\n\nRewarded ad units enable users to play games, take surveys, or watch videos to\nearn in-app rewards, such as coins, extra lives, or points. You can set\ndifferent rewards for different ad units, and specify the reward values and\nitems the user received. \n\n[Implement rewarded ads](/admob/android/rewarded)\n\n### Rewarded interstitial\n\nRewarded interstitial is a new type of incentivized ad format that lets you\noffer rewards, such as coins or extra lives, for ads that appear automatically\nduring natural app transitions.\n\nUnlike rewarded ads, users aren't required to opt in to view a rewarded\ninterstitial.\n\nInstead of the opt-in prompt in rewarded ads, rewarded interstitials require an\nintro screen that announces the reward and gives users a chance to opt out if\nthey want to do so. \n\n[Implement rewarded interstitial ads](/admob/android/rewarded-interstitial)\n\n### App open\n\nApp open is an ad format that appears when users open or switch back to your\napp. The ad overlays the loading screen. \n\n[Implement app open ads](/admob/android/app-open)\n\nAdditional resources\n--------------------\n\nThe [Google Mobile Ads repository](//github.com/googleads/googleads-mobile-android-examples) on GitHub demonstrates\nhow to use the different ad formats that this API offers."]]