All skills
google avatar

/google-mobile-ads-get-started

@329fa26
by googlegoogle/skills21k stars
1,698

Provides instructions for integrating the Google Mobile Ads (GMA) SDK. Use this skill when the user wants to get started with, install, integrate, set up, or configure the SDK for AdMob or Ad Manager, GMA Next-Gen SDK or mobile ads framework in an Android, iOS, or Unity application.

Use this Skill: https://skilld.dev/gh/google/skills/google-mobile-ads-get-started

This session only. Nothing lands on disk.

referencesandroid-get-started.md

≈710 tokens on demand. Your agent reads this file only when SKILL.md points to it.

AI Integration Agent Instructions for the Android GMA Next-Gen SDK

Required Imports

Use the following imports to initialize the GMA Next-Gen SDK:

import com.google.android.libraries.ads.mobile.sdk.MobileAds
import com.google.android.libraries.ads.mobile.sdk.initialization.InitializationConfig
import com.google.android.libraries.ads.mobile.sdk.initialization.InitializationStatus
import com.google.android.libraries.ads.mobile.sdk.initialization.OnAdapterInitializationCompleteListener

Method Signatures

Use the following method signature to initialize the GMA Next-Gen SDK:

fun initialize(
    context: Context,
    initializationConfig: InitializationConfig,
    listener: OnAdapterInitializationCompleteListener?
): Unit

The InitializationConfig object takes the AdMob App ID:

InitializationConfig.Builder("ca-app-pub-3940256099942544~3347511713").build()

The OnAdapterInitializationCompleteListener interface is defined as:

fun interface OnAdapterInitializationCompleteListener {
    fun onAdapterInitializationComplete(status: InitializationStatus): Unit
}

SDK Integration Workflow

  1. Add the SDK dependency:

    • ALWAYS Add the latest stable version of com.google.android.libraries.ads.mobile.sdk:ads-mobile-sdk to dependencies. If you cannot access Maven directly, run the following command to fetch the latest version. The version returned in the latest tag is the latest version of the Google Mobile Ads SDK:

      curl -sS https://dl.google.com/dl/android/maven2/com/google/android/libraries/ads/mobile/sdk/ads-mobile-sdk/maven-metadata.xml | sed -n 's/.*<latest>\(.*\)<\/latest>.*/\1/p'
    • Configure minSdk (24+) and compileSdk (34+).

    • Exclude play-services-ads and play-services-ads-lite from all dependencies globally in the app-level build file to avoid duplicate symbol errors.

    • Sync Gradle before moving on to the next step.

  2. Set the application identifier:

    • Pass the applicationId parameter programmatically in the InitializationConfig.Builder with a sample AdMob App ID of ca-app-pub-3940256099942544~3347511713. Remind the user to replace it with their actual AdMob App ID before publishing.
  3. Initialize the SDK:

    • ALWAYS initialize the SDK on a background thread.
  4. Verify the integration:

    • Run gradle build -x test to confirm a successful clean build. Resolve any GMA SDK related compile errors.

Links

Additional documentation:

Source: SKILL.md on GitHub

No alerts8d3 checks · Risk SAFE
  • Gen Agent Trust Hub8d

    This skill facilitates the integration of the Google Mobile Ads SDK across Android, iOS, and Unity platforms. It utilizes standard development tools and official Google resources to automate version discovery and project configuration. The skill includes automated steps for building and verifying the project, ensuring a consistent setup experience for developers.

  • Socket8d

    No alerts

  • Snyk8d

    Risk: LOW · No issues

Signed by skilld at 329fa26. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub yesterday.

Activeupdated last week
metadata
{
  "version": "1.2.0",
  "category": "GoogleAds"
}

README badge

README badge for google/skills/google-mobile-ads-get-started