Stay organized with collections
Save and categorize content based on your preferences.
Classes
Objects
Annotations
Enums
AdFormat |
Format of the ad being requested.
|
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2025-08-20 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-20 UTC."],[[["\u003cp\u003e\u003ccode\u003ecom.google.android.gms.ads\u003c/code\u003e provides classes, objects, annotations, and enums for managing and displaying ads in Android applications using Kotlin or Java.\u003c/p\u003e\n"],["\u003cp\u003eThe package includes key functionalities such as handling ad errors (\u003ccode\u003eAdError\u003c/code\u003e), defining ad sizes (\u003ccode\u003eAdSize\u003c/code\u003e), and controlling video playback within ads (\u003ccode\u003eVideoController\u003c/code\u003e, \u003ccode\u003eVideoOptions\u003c/code\u003e).\u003c/p\u003e\n"],["\u003cp\u003eIt offers global configurations for ad requests through \u003ccode\u003eRequestConfiguration\u003c/code\u003e and allows setting parameters like content rating and child-directed treatment.\u003c/p\u003e\n"],["\u003cp\u003eDevelopers can utilize \u003ccode\u003eMobileAds\u003c/code\u003e for compatibility with mediation adapters, while \u003ccode\u003eMediationUtils\u003c/code\u003e provides additional utilities for mediation.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003eAdFormat\u003c/code\u003e helps define the format of the ad being requested, while information about the Google Mobile Ads SDK version is available via \u003ccode\u003eVersionInfo\u003c/code\u003e.\u003c/p\u003e\n"]]],["This package, `com.google.android.gms.ads`, in Kotlin, defines components for managing ads within applications. Key elements include `AdError` for error reporting, `AdSize` for banner dimensions, and `RequestConfiguration` for setting global ad request parameters. `VideoController` and its callbacks manage video ad playback. `VideoOptions` configures video playback. Annotations specify allowed values for content ratings and child-directed treatment. The `AdFormat` enum specifies the type of ad requested. `MobileAds` is for compatibility.\n"],null,["# com.google.android.gms.ads\n==========================\n\nKotlin \\|[Java](/admob/android/early-access/nextgen/reference/com/google/android/gms/ads/package-summary \"View this page in Java\") \n\nClasses\n-------\n\n|--------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------|\n| [AdError](/admob/android/early-access/nextgen/reference/kotlin/com/google/android/gms/ads/AdError) | Error information about why an ad operation failed. |\n| [AdSize](/admob/android/early-access/nextgen/reference/kotlin/com/google/android/gms/ads/AdSize) | The size of a banner ad. |\n| [MediaContent](/admob/android/early-access/nextgen/reference/kotlin/com/google/android/gms/ads/MediaContent) | |\n| [RequestConfiguration](/admob/android/early-access/nextgen/reference/kotlin/com/google/android/gms/ads/RequestConfiguration) | Global configuration that will be used for every ad request. |\n| [VersionInfo](/admob/android/early-access/nextgen/reference/kotlin/com/google/android/gms/ads/VersionInfo) | Version information. |\n| [VideoController](/admob/android/early-access/nextgen/reference/kotlin/com/google/android/gms/ads/VideoController) | An object that provides playback control for video ads. |\n| [VideoController.VideoLifecycleCallbacks](/admob/android/early-access/nextgen/reference/kotlin/com/google/android/gms/ads/VideoController.VideoLifecycleCallbacks) | Callback for receiving updates on video ad lifecycle events. |\n| [VideoOptions](/admob/android/early-access/nextgen/reference/kotlin/com/google/android/gms/ads/VideoOptions) | Options for controlling video playback in supported ad formats. |\n| [VideoOptions.Builder](/admob/android/early-access/nextgen/reference/kotlin/com/google/android/gms/ads/VideoOptions.Builder) | Builder for [VideoOptions](/admob/android/early-access/nextgen/reference/kotlin/com/google/android/gms/ads/VideoOptions). |\n\nObjects\n-------\n\n|------------------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------|\n| [MediationUtils](/admob/android/early-access/nextgen/reference/kotlin/com/google/android/gms/ads/MediationUtils) | |\n| [MobileAds](/admob/android/early-access/nextgen/reference/kotlin/com/google/android/gms/ads/MobileAds) | This class is present only for compatibility with mediation adapters. |\n\nAnnotations\n-----------\n\n|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-----------------------------------------------------|\n| [RequestConfiguration.MaxAdContentRating](/admob/android/early-access/nextgen/reference/kotlin/com/google/android/gms/ads/RequestConfiguration.MaxAdContentRating) | Allowed constants for MaxAdContentRating. |\n| [RequestConfiguration.TagForChildDirectedTreatment](/admob/android/early-access/nextgen/reference/kotlin/com/google/android/gms/ads/RequestConfiguration.TagForChildDirectedTreatment) | Allowed constants for TagForChildDirectedTreatment. |\n| [RequestConfiguration.TagForUnderAgeOfConsent](/admob/android/early-access/nextgen/reference/kotlin/com/google/android/gms/ads/RequestConfiguration.TagForUnderAgeOfConsent) | Allowed constants for TagForUnderAgeOfConsent. |\n| [VideoController.PlaybackState](/admob/android/early-access/nextgen/reference/kotlin/com/google/android/gms/ads/VideoController.PlaybackState) | The playback state of the video ad. |\n\nEnums\n-----\n\n|------------------------------------------------------------------------------------------------------|-----------------------------------|\n| [AdFormat](/admob/android/early-access/nextgen/reference/kotlin/com/google/android/gms/ads/AdFormat) | Format of the ad being requested. |"]]