AI 도구 (베타)와 Google 모바일 광고 SDK 통합

AI 지원 출력을 최적화하려면 AI 환경에 기능을 추가하세요. 기능을 추가하면 AI 도구에 Google Mobile Ads SDK과 관련된 컨텍스트를 제공하고 AI 지원 코드 생성의 출력을 개선할 수 있습니다.

이 가이드에서는 Google Mobile Ads SDK용 AI 모델 최적화에 관해 설명합니다.

기본 요건

Android 스튜디오를 사용하는 경우 다음을 실행합니다.

기능 추가

Google은 AI 도구에 다음 통합 단계를 지원하는 안내가 포함된 SKILL.md 파일을 제공합니다.

  • 프로젝트에 Google Mobile Ads SDK을 추가합니다.
  • 배너 광고를 구현합니다.

AI 도구에서 Google Mobile Ads SDK와 관련된 스킬을 사용하려면 다음 단계를 따르세요.

Android 스튜디오

  1. 프로젝트의 루트 디렉터리에서 .skills/라는 폴더를 만듭니다.

  2. gma-android-integrate라는 스킬의 디렉터리를 만듭니다.

  3. gma-android-integrate 디렉터리에서 SKILL.md라는 파일을 만듭니다.

  4. SKILL.md 파일에 다음 안내를 추가합니다.

    ---
    name: gma-android-integrate
    description: Provides technical specifications and implementation details for
      the play-services-ads Google Mobile Ads SDK
      (com.google.android.gms:play-services-ads), including Gradle dependencies,
      manifest metadata, initialization patterns, and banner ad configurations. Use
      ONLY for the play-services-ads Google Mobile Ads SDK. Do NOT use for GMA
      Next-Gen SDK (com.google.android.libraries.ads.mobile.sdk:ads-mobile-sdk)
      integrations.
    metadata:
      version: 1.0
    ---
    
    # AI Integration Agent Instructions for the Play Services Google Mobile Ads SDK
    
    ## SDK Integration Workflow
    
    *   **Configure Gradle**:
        -   [ ] Add the latest stable version of
            `com.google.android.gms:play-services-ads` to dependencies.
        -   [ ] Configure `minSdk` (23+) and `compileSdk` (35+).
        -   [ ] Sync Gradle before moving on to the next step.
    *   **Manifest Configuration**:
        -   [ ] Add the following metadata to the `<application>` tag in the
            `AndroidManifest.xml` file:
            ```xml
            <!-- Sample AdMob app ID: ca-app-pub-3940256099942544~3347511713 -->
            <meta-data
                android:name="com.google.android.gms.ads.APPLICATION_ID"
                android:value="ca-app-pub-3940256099942544~3347511713"/>
            ```
            **Note**: The sample AdMob App ID
            `ca-app-pub-3940256099942544~3347511713` is for testing purposes only.
            **ALWAYS** remind the user to replace it with their actual AdMob App ID
            before publishing.
    *   **Initialize SDK**:
        -   [ ] Initialize SDK on a background thread.
    
    ### Implementation Details
    
    *   **Version Management**: **ALWAYS** look up and use the latest stable
        version. Do not assume a version number.
    *   **Initialization**: **ALWAYS** call `MobileAds.initialize()` on a background
        thread.
    
    ## Banner Ads
    
    Banner ads are rectangular image or text ads that occupy a spot within an app's
    layout. They remain on screen during user interaction and can refresh
    automatically.
    
    ### Strategic Recommendations
    
    *   **Confirm Ad Type**: If the user asks for a "banner ad" without specifying a
        type, confirm the desired type.
    *   **Suggest Large Anchored Adaptive**: Suggest large anchored adaptive banners
        over "fixed size". Explain they are designed to increase engagement and
        revenue potential. If told that large adaptive is too large, suggest
        standard anchored adaptive over fixed size ads.
    *   **Type Clarifications**:
        *   **Anchored Adaptive**: Ask if it should be anchored to the **top** or
            **bottom**.
        *   **Inline Adaptive**: Use this type for ads placed inside scrollable
            content (e.g., `RecyclerView` or `ScrollView`). **Validate** the ad
            container is scrollable before implementing; if not scrollable, default
            to **Large Anchored Adaptive**.
    
    ### Implementation Checklist
    
    -   [ ] Create UI container for `AdView`.
    -   [ ] Initialize `AdView` with ad unit ID and ad size.
    -   [ ] Call `adView.loadAd()`.
    -   [ ] **Mandatory**: Add `adView.destroy()` to the appropriate lifecycle
        cleanup (e.g., `onDestroy`).

    자세한 내용은 스킬로 에이전트 모드 확장을 참고하세요.

프롬프트에서 스킬 호출

프로젝트에 스킬을 추가한 후 다음 예시 프롬프트를 사용하여 AI 도구에서 스킬을 호출합니다.

Android 스튜디오

스킬을 호출하려면 @를 입력하고 gma-android-integrate 스킬을 선택합니다.

Google Mobile Ads SDK 통합

@gma-android-integrate Integrate the latest version of Google Mobile Ads SDK to my project.

배너 추가하기

@gma-android-integrate Add an anchored adaptive banner ad to the bottom of the screen.

의견 남기기

Google은 Google Mobile Ads SDK 주제에 관한 응답을 개선하기 위해 AI 코드 지원 도구에 제공되는 컨텍스트를 지속적으로 평가하고 최적화하고 있습니다.

Gemini 최적화에 관한 의견이 있다면 Google Mobile Ads SDK Discord 채널에 참여하세요.Google Mobile Ads SDK