When building and testing your apps, make sure you use test ads rather than
live, production ads. Failure to do so can lead to suspension of your account.
The easiest way to load test ads is to use our dedicated test ad unit ID for
Android rewarded ads:
/21775744923/example/rewarded
It's been specially configured to return test ads for every request, and you're
free to use it in your own apps while coding, testing, and debugging. Just make
sure you replace it with your own ad unit ID before publishing your app.
For more information about how Next Gen Mobile Ads SDK test ads work, see Test
Ads.
Load an ad
To load a rewarded ad, call the RewardedAd static load() method and
pass in an AdLoadCallback<RewardedAd> to receive the loaded ad or any possible
errors.
Kotlin
importcom.google.android.libraries.ads.mobile.sdk.common.AdLoadCallbackimportcom.google.android.libraries.ads.mobile.sdk.common.AdRequestimportcom.google.android.libraries.ads.mobile.sdk.common.FullScreenContentErrorimportcom.google.android.libraries.ads.mobile.sdk.common.LoadAdErrorimportcom.google.android.libraries.ads.mobile.sdk.rewarded.RewardedAdimportcom.google.android.libraries.ads.mobile.sdk.rewarded.RewardedAdEventCallbackimportcom.google.android.libraries.ads.mobile.sdk.MobileAdsclassRewardedActivity:Activity(){privatevarrewardedAd:RewardedAd? =nulloverridefunonCreate(savedInstanceState:Bundle?){super.onCreate(savedInstanceState)// Load ads after you inititalize Next Gen Mobile Ads SDK.RewardedAd.load(AdRequest.Builder(AD_UNIT_ID).build(),object:AdLoadCallback<RewardedAd>{overridefunonAdLoaded(ad:RewardedAd){// Rewarded ad loaded.rewardedAd=ad}overridefunonAdFailedToLoad(adError:LoadAdError){// Rewarded ad failed to load.rewardedAd=null}},)}companionobject{// Sample rewarded ad unit ID.constvalAD_UNIT_ID="/21775744923/example/rewarded"}}
Java
importcom.google.android.libraries.ads.mobile.sdk.common.AdLoadCallback;importcom.google.android.libraries.ads.mobile.sdk.common.AdRequest;importcom.google.android.libraries.ads.mobile.sdk.common.FullScreenContentError;importcom.google.android.libraries.ads.mobile.sdk.common.LoadAdError;importcom.google.android.libraries.ads.mobile.sdk.rewarded.RewardedAd;importcom.google.android.libraries.ads.mobile.sdk.rewarded.RewardedAdEventCallback;importcom.google.android.libraries.ads.mobile.sdk.MobileAds;classRewardedActivityextendsActivity{// Sample rewarded ad unit ID.privatestaticfinalStringAD_UNIT_ID="/21775744923/example/rewarded";privateRewardedAdrewardedAd;@OverrideprotectedvoidonCreate(BundlesavedInstanceState){super.onCreate(savedInstanceState);// Load ads after you initialize Next Gen Mobile Ads SDK.RewardedAd.load(newAdRequest.Builder(AD_UNIT_ID).build(),newAdLoadCallback<RewardedAd>(){@OverridepublicvoidonAdLoaded(@NonNullRewardedAdrewardedAd){// Rewarded ad loaded.AdLoadCallback.super.onAdLoaded(rewardedAd);RewardedActivity.this.rewardedAd=rewardedAd;}@OverridepublicvoidonAdFailedToLoad(@NonNullLoadAdErroradError){// Rewarded ad failed to load.AdLoadCallback.super.onAdFailedToLoad(adError);rewardedAd=null;}});}}
Set the RewardedAdEventCallback
The RewardedAdEventCallback handles events related to displaying your
RewardedAd. Before showing the rewarded ad, make sure to set the
callback:
Kotlin
// Listen for ad events.rewardedAd?.adEventCallback=object:RewardedAdEventCallback{overridefunonAdShowedFullScreenContent(){// Rewarded ad did show.}overridefunonAdDismissedFullScreenContent(){// Rewarded ad did dismiss.rewardedAd=null}overridefunonAdFailedToShowFullScreenContent(fullScreenContentError:FullScreenContentError){// Rewarded ad failed to show.rewardedAd=null}overridefunonAdImpression(){// Rewarded ad did record an impression.}overridefunonAdClicked(){// Rewarded ad did record a click.}}
Java
// Listen for ad events.rewardedAd.setAdEventCallback(newRewardedAdEventCallback(){@OverridepublicvoidonAdShowedFullScreenContent(){// Rewarded ad did show.RewardedAdEventCallback.super.onAdShowedFullScreenContent();}@OverridepublicvoidonAdDismissedFullScreenContent(){// Rewarded ad did dismiss.RewardedAdEventCallback.super.onAdDismissedFullScreenContent();rewardedAd=null;}@OverridepublicvoidonAdFailedToShowFullScreenContent(@NonNullFullScreenContentErrorfullScreenContentError){// Rewarded ad failed to show.RewardedAdEventCallback.super.onAdFailedToShowFullScreenContent(fullScreenContentError);rewardedAd=null;}@OverridepublicvoidonAdImpression(){// Rewarded ad did record an impression.RewardedAdEventCallback.super.onAdImpression();}@OverridepublicvoidonAdClicked(){// Rewarded ad did record a click.RewardedAdEventCallback.super.onAdClicked();}});
Show the ad
To show a rewarded ad, use the show() method. Use an
OnUserEarnedRewardListener object to handle reward events.
Kotlin
// Show the ad.rewardedAd?.show(this@RewardedActivity,object:OnUserEarnedRewardListener{overridefunonUserEarnedReward(rewardItem:RewardItem){// User earned the reward.valrewardAmount=rewardItem.amountvalrewardType=rewardItem.type}},)
Java
// Show the ad.rewardedAd.show(RewardedActivity.this,newOnUserEarnedRewardListener(){@OverridepublicvoidonUserEarnedReward(@NonNullRewardItemrewardItem){// User earned the reward.intrewardAmount=rewardItem.getAmount();StringrewardType=rewardItem.getType();}});
FAQ
Is there a timeout for the initialization call?
After 10 seconds, Next Gen Mobile Ads SDK invokes the
OnInitializationCompleteListener even if a mediation network still hasn't
completed initialization.
What if some mediation networks aren't ready when I get the initialization callback?
We recommend loading an ad inside the callback of the
OnInitializationCompleteListener. Even if a mediation network is not ready,
Next Gen Mobile Ads SDK still asks that network for an ad. So if a
mediation network finishes initializing after the timeout, it can still
service future ad requests in that session.
You can continue to poll the initialization status of all adapters throughout
your app session by calling MobileAds.getInitializationStatus().
How do I find out why a particular mediation network isn't ready?
AdapterStatus.getDescription() describes why an adapter is not ready to
service ad requests.
For Google ads, all onUserEarnedReward() calls occur before
onAdDismissedFullScreenContent(). For ads served through
mediation, the third-party ad
network SDK's implementation determines the callback order. For ad network
SDKs that provide a single close callback with reward information, the
mediation adapter invokes onUserEarnedReward() before
onAdDismissedFullScreenContent().
Example
Download and run the
example app
that demonstrates the use of the Next Gen Mobile Ads SDK.
[[["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-09-04 UTC."],[[["\u003cp\u003eRewarded ads incentivize user interaction with video ads, playable ads, and surveys by offering in-app rewards.\u003c/p\u003e\n"],["\u003cp\u003eBefore publishing, replace the test ad unit ID \u003ccode\u003e/21775744923/example/rewarded\u003c/code\u003e with your own ad unit ID for production.\u003c/p\u003e\n"],["\u003cp\u003eLoad rewarded ads using the \u003ccode\u003eRewardedAd\u003c/code\u003e static \u003ccode\u003eload()\u003c/code\u003e method and handle events with \u003ccode\u003eRewardedAdEventCallback\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eDisplay the loaded rewarded ad with the \u003ccode\u003eshow()\u003c/code\u003e method and utilize \u003ccode\u003eOnUserEarnedRewardListener\u003c/code\u003e to process reward events.\u003c/p\u003e\n"],["\u003cp\u003eEnsure the Google Mobile Ads SDK is initialized before loading ads to avoid errors.\u003c/p\u003e\n"]]],["Rewarded ads allow in-app rewards for user interaction. To use them, you must first initialize the Google Mobile Ads SDK. Load ads using `RewardedAd.load()` with an `AdLoadCallback`. Set `RewardedAdEventCallback` to handle display events like showing, dismissing, and errors. Utilize `show()` with `OnUserEarnedRewardListener` to display the ad and reward users. Use test ads via the provided ID `/21775744923/example/rewarded` during development, and ensure you replace this with the ID for your own app before publishing.\n"],null,["[Rewarded ads](//support.google.com/admanager/answer/7386053) allow you to reward users with in-app items for interacting with video ads, playable ads, and surveys.\n\n\u003cbr /\u003e\n\nPrerequisites\n- Complete the [Get started guide](/ad-manager/mobile-ads-sdk/android/early-access/nextgen/quick-start).\n\nAlways test with test ads\n- When building and testing your apps, make sure you use test ads rather than live, production ads. Failure to do so can lead to suspension of your account.\n- The easiest way to load test ads is to use our dedicated test ad unit ID for Android rewarded ads:\n- `/21775744923/example/rewarded`\n- It's been specially configured to return test ads for every request, and you're free to use it in your own apps while coding, testing, and debugging. Just make sure you replace it with your own ad unit ID before publishing your app.\n- For more information about how Next Gen Mobile Ads SDK test ads work, see [Test\n Ads](/ad-manager/mobile-ads-sdk/android/early-access/nextgen/test-ads).\n\nLoad an ad\n- To load a rewarded ad, call the `RewardedAd` static `load()` method and pass in an `AdLoadCallback\u003cRewardedAd\u003e` to receive the loaded ad or any possible errors.\n**Warning:** Before loading ads, you must initialize Next Gen Mobile Ads SDK. \n\nKotlin \n\n import com.google.android.libraries.ads.mobile.sdk.common.AdLoadCallback\n import com.google.android.libraries.ads.mobile.sdk.common.AdRequest\n import com.google.android.libraries.ads.mobile.sdk.common.FullScreenContentError\n import com.google.android.libraries.ads.mobile.sdk.common.LoadAdError\n import com.google.android.libraries.ads.mobile.sdk.rewarded.RewardedAd\n import com.google.android.libraries.ads.mobile.sdk.rewarded.RewardedAdEventCallback\n import com.google.android.libraries.ads.mobile.sdk.MobileAds\n\n class RewardedActivity : Activity() {\n private var rewardedAd: RewardedAd? = null\n\n override fun onCreate(savedInstanceState: Bundle?) {\n super.onCreate(savedInstanceState)\n\n // Load ads after you inititalize Next Gen Mobile Ads SDK.\n RewardedAd.load(\n AdRequest.Builder(AD_UNIT_ID).build(),\n object : AdLoadCallback\u003cRewardedAd\u003e {\n override fun onAdLoaded(ad: RewardedAd) {\n // Rewarded ad loaded.\n rewardedAd = ad\n }\n\n override fun onAdFailedToLoad(adError: LoadAdError) {\n // Rewarded ad failed to load.\n rewardedAd = null\n }\n },\n )\n }\n\n companion object {\n // Sample rewarded ad unit ID.\n const val AD_UNIT_ID = \"/21775744923/example/rewarded\"\n }\n }\n\nJava \n\n import com.google.android.libraries.ads.mobile.sdk.common.AdLoadCallback;\n import com.google.android.libraries.ads.mobile.sdk.common.AdRequest;\n import com.google.android.libraries.ads.mobile.sdk.common.FullScreenContentError;\n import com.google.android.libraries.ads.mobile.sdk.common.LoadAdError;\n import com.google.android.libraries.ads.mobile.sdk.rewarded.RewardedAd;\n import com.google.android.libraries.ads.mobile.sdk.rewarded.RewardedAdEventCallback;\n import com.google.android.libraries.ads.mobile.sdk.MobileAds;\n\n class RewardedActivity extends Activity {\n // Sample rewarded ad unit ID.\n private static final String AD_UNIT_ID = \"/21775744923/example/rewarded\";\n private RewardedAd rewardedAd;\n\n @Override\n protected void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n\n // Load ads after you initialize Next Gen Mobile Ads SDK.\n RewardedAd.load(\n new AdRequest.Builder(AD_UNIT_ID).build(),\n new AdLoadCallback\u003cRewardedAd\u003e() {\n @Override\n public void onAdLoaded(@NonNull RewardedAd rewardedAd) {\n // Rewarded ad loaded.\n AdLoadCallback.super.onAdLoaded(rewardedAd);\n RewardedActivity.this.rewardedAd = rewardedAd;\n }\n\n @Override\n public void onAdFailedToLoad(@NonNull LoadAdError adError) {\n // Rewarded ad failed to load.\n AdLoadCallback.super.onAdFailedToLoad(adError);\n rewardedAd = null;\n }\n }\n );\n }\n }\n\nSet the RewardedAdEventCallback\n- The `RewardedAdEventCallback` handles events related to displaying your `RewardedAd`. Before showing the rewarded ad, make sure to set the callback: \n\nKotlin \n\n // Listen for ad events.\n rewardedAd?.adEventCallback =\n object : RewardedAdEventCallback {\n override fun onAdShowedFullScreenContent() {\n // Rewarded ad did show.\n }\n\n override fun onAdDismissedFullScreenContent() {\n // Rewarded ad did dismiss.\n rewardedAd = null\n }\n\n override fun onAdFailedToShowFullScreenContent(\n fullScreenContentError: FullScreenContentError\n ) {\n // Rewarded ad failed to show.\n rewardedAd = null\n }\n\n override fun onAdImpression() {\n // Rewarded ad did record an impression.\n }\n\n override fun onAdClicked() {\n // Rewarded ad did record a click.\n }\n }\n\nJava \n\n // Listen for ad events.\n rewardedAd.setAdEventCallback(\n new RewardedAdEventCallback() {\n @Override\n public void onAdShowedFullScreenContent() {\n // Rewarded ad did show.\n RewardedAdEventCallback.super.onAdShowedFullScreenContent();\n }\n\n @Override\n public void onAdDismissedFullScreenContent() {\n // Rewarded ad did dismiss.\n RewardedAdEventCallback.super.onAdDismissedFullScreenContent();\n rewardedAd = null;\n }\n\n @Override\n public void onAdFailedToShowFullScreenContent(\n @NonNull FullScreenContentError fullScreenContentError) {\n // Rewarded ad failed to show.\n RewardedAdEventCallback.super.onAdFailedToShowFullScreenContent(\n fullScreenContentError);\n rewardedAd = null;\n }\n\n @Override\n public void onAdImpression() {\n // Rewarded ad did record an impression.\n RewardedAdEventCallback.super.onAdImpression();\n }\n\n @Override\n public void onAdClicked() {\n // Rewarded ad did record a click.\n RewardedAdEventCallback.super.onAdClicked();\n }\n }\n );\n\nShow the ad\n- To show a rewarded ad, use the `show()` method. Use an `OnUserEarnedRewardListener` object to handle reward events. \n\nKotlin \n\n // Show the ad.\n rewardedAd?.show(\n this@RewardedActivity,\n object : OnUserEarnedRewardListener {\n override fun onUserEarnedReward(rewardItem: RewardItem) {\n // User earned the reward.\n val rewardAmount = rewardItem.amount\n val rewardType = rewardItem.type\n }\n },\n )\n\nJava \n\n // Show the ad.\n rewardedAd.show(\n RewardedActivity.this,\n new OnUserEarnedRewardListener() {\n @Override\n public void onUserEarnedReward(@NonNull RewardItem rewardItem) {\n // User earned the reward.\n int rewardAmount = rewardItem.getAmount();\n String rewardType = rewardItem.getType();\n }\n });\n\nFAQ\n\nIs there a timeout for the initialization call?\n: After 10 seconds, Next Gen Mobile Ads SDK invokes the\n `OnInitializationCompleteListener` even if a mediation network still hasn't\n completed initialization.\n\nWhat if some mediation networks aren't ready when I get the initialization callback?\n\n: We recommend loading an ad inside the callback of the\n `OnInitializationCompleteListener`. Even if a mediation network is not ready,\n Next Gen Mobile Ads SDK still asks that network for an ad. So if a\n mediation network finishes initializing after the timeout, it can still\n service future ad requests in that session.\n\n You can continue to poll the initialization status of all adapters throughout\n your app session by calling `MobileAds.getInitializationStatus()`.\n\nHow do I find out why a particular mediation network isn't ready?\n\n: `AdapterStatus.getDescription()` describes why an adapter is not ready to\n service ad requests.\n\nDoes the [`onUserEarnedReward()`](/ad-manager/mobile-ads-sdk/android/early-access/nextgen/reference/kotlin/com/google/android/libraries/ads/mobile/sdk/rewarded/OnUserEarnedRewardListener#onUserEarnedReward(com.google.android.libraries.ads.mobile.sdk.rewarded.RewardItem)) callback always get called before the [`onAdDismissedFullScreenContent()`](/ad-manager/mobile-ads-sdk/android/early-access/nextgen/reference/kotlin/com/google/android/libraries/ads/mobile/sdk/common/AdEventCallback#onAdDismissedFullScreenContent()) callback?\n\n: For Google ads, all `onUserEarnedReward()` calls occur before\n `onAdDismissedFullScreenContent()`. For ads served through\n [mediation](/ad-manager/mobile-ads-sdk/android/early-access/nextgen/mediation), the third-party ad\n network SDK's implementation determines the callback order. For ad network\n SDKs that provide a single close callback with reward information, the\n mediation adapter invokes `onUserEarnedReward()` before\n `onAdDismissedFullScreenContent()`.\n\nExample\n- Download and run the [example app](//drive.google.com/drive/folders/1Akdh63mFZUZU456t-rvNxBBzL6guNtYj?usp=sharing) that demonstrates the use of the Next Gen Mobile Ads SDK."]]