65 Comments

  • Alexio Vay

    I've just implemented interstitial ads which also sometime contains videos. Is there a difference regarding being able to close a video ad?

  • woodii

    hey, thanks for another nice video from you.
    I am still wondering which Theme you are using for Android Studio.
    Default Dracula Theme isn't my favourite yet.

  • Muhammad Mahmood

    Please any one! i have a problem in my admob account… where should i log this issue to admob…
    my admob did not create ids of interstitial and banner…

  • Raj N

    Hi,
    Thanks for this awesome tutorial. I have implemented the same, rewarded videos are also shown, but after user watch full video, I am releasing reward points to user but not getting money for which I have released reward points to user. Getting money only when user watch whole video, then click on ads. I need a solution to monetize when user watch full video. CTR shouldn't compulsory to monetize money. Can I get money when user watch full rewarded video?

  • Skania

    Is it possible to load ads in one activity and then show them from other activity? I would like to load them in mainactivity and then show them from any other place in application.

  • Zey mon

    I don't mind listening to this guy for 13 seconds while I test the ad feature. What really annoys me is the other test ad for "Creative Preview" which steals 51 seconds of my time every time I want to receive an onRewarded callback.

  • CeuxDruman

    Hey guys! Don't you have any issue these days with Video Rewarded Ads? Today my banner ad shows a "AdMob Test Smart Banner" with slide instead of Congrats or Youtube testing ads (but still working) and the Video Rewarded Ad doesn't load with the errors "Fail to instantiate adapter com.google.DummyAdapter" and "Failed to load ad: 3".

  • Md Iftekhar

    I used tested ca pub code ad it worked but when I used my own ca pub ad. It shows continuously rewarded video failed to load. Pls say me some solution…

  • TechnoBytes

    why my video ad is not loading can anyone help me
    here is my code it always give me
    "Ad failed to load"

    package com.tech.myapplication;

    import android.os.Bundle;
    import android.support.v7.app.AppCompatActivity;
    import android.view.View;
    import android.widget.Toast;

    import com.google.android.gms.ads.AdRequest;
    import com.google.android.gms.ads.MobileAds;
    import com.google.android.gms.ads.reward.RewardItem;
    import com.google.android.gms.ads.reward.RewardedVideoAd;
    import com.google.android.gms.ads.reward.RewardedVideoAdListener;

    public class MainActivity extends AppCompatActivity implements RewardedVideoAdListener {
    private RewardedVideoAd mAd;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);
    MobileAds.initialize(this,"ca-app-pub-3940256099942544~3347511713");

    mAd = MobileAds.getRewardedVideoAdInstance(this);
    mAd.setRewardedVideoAdListener(this);
    loadAdfunction();

    }

    private void loadAdfunction() {
    Toast.makeText(this,"load function",Toast.LENGTH_SHORT).show();
    AdRequest adRequest = new AdRequest.Builder().build();
    mAd.loadAd("ca-app-pub-3940256099942544/5224354917", adRequest);
    }

    @Override
    public void onRewardedVideoAdLoaded() {
    Toast.makeText(this," ad loaded successfully",Toast.LENGTH_SHORT).show();
    }

    @Override
    public void onRewardedVideoAdOpened() {

    }

    @Override
    public void onRewardedVideoStarted() {

    }

    @Override
    public void onRewardedVideoAdClosed() {

    }

    @Override
    public void onRewarded(RewardItem rewardItem) {

    }

    @Override
    public void onRewardedVideoAdLeftApplication() {

    }

    @Override
    public void onRewardedVideoAdFailedToLoad(int i) {
    Toast.makeText(this,"Ad failed to load",Toast.LENGTH_SHORT).show();
    }

    @Override
    public void onResume() {
    mAd.resume(this);
    super.onResume();
    }

    @Override
    public void onPause() {
    mAd.pause(this);
    super.onPause();
    }

    @Override
    public void onDestroy() {
    mAd.destroy(this);
    super.onDestroy();
    }

    public void show(View view) {
    if (mAd.isLoaded())
    {
    mAd.show();
    }
    else
    { Toast.makeText(this,"Button clicked ad not loaded",Toast.LENGTH_SHORT).show();
    loadAdfunction();
    }

    }
    }

    my graddle file (app)

    apply plugin: 'com.android.application'

    android {
    compileSdkVersion 26
    defaultConfig {
    applicationId "com.tech.myapplication"
    minSdkVersion 16
    targetSdkVersion 26
    versionCode 1
    versionName "1.0"
    testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    }
    buildTypes {
    release {
    minifyEnabled false
    proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
    }
    }
    }

    dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    implementation 'com.android.support:appcompat-v7:26.1.0'
    implementation 'com.android.support.constraint:constraint-layout:1.0.2'
    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'com.android.support.test:runner:1.0.1'
    androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1'
    compile 'com.google.android.gms:play-services-ads:11.8.0'
    }

  • Zia ur Rehman

    I did the same as you instructed, but my Ads are not loaded and didn't show , I can share my Code with you. Please check what am I doing wrong. I spent 2 days upon this bloody simple task, but didn't get the positive result. please help.

    IDs are put in strings
    <string name="temp_googleRewardedAppID" translatable="false">ca-app-pub-3940256099942544~3347511713</string>
    <string name="temp_rewardedID" translatable="false">ca-app-pub-3940256099942544/5224354917</string>

    Gradle Entires

    //GOOGLE REWARDED ADS
    allprojects {
    repositories {
    jcenter()
    maven {
    url "https://maven.google.com"
    }
    }
    }

    and in dependencies
    //GOOGLE REWARDED ADS
    compile 'com.google.android.gms:play-services-ads:11.8.0'

    MainPage Code is

    public class MainActivity extends AppCompatActivity implements RewardedVideoAdListener {
    private RewardedVideoAd rewardedVideoAd;
    private TextView statusText;
    private Button loadButton, showButton;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);

    MobileAds.initialize(this, this.getString(R.string.temp_googleRewardedAppID));
    rewardedVideoAd = MobileAds.getRewardedVideoAdInstance(this);
    rewardedVideoAd.setRewardedVideoAdListener(this);

    loadRewardedAd();

    initControls();
    }

    private void initControls() {
    statusText = (TextView) findViewById(R.id.statusTxt);
    loadButton = (Button) findViewById(R.id.loadBtn);
    loadButton.setOnClickListener(new View.OnClickListener() {
    @Override
    public void onClick(View v) {
    loadRewardedAd();
    }
    });
    showButton = (Button) findViewById(R.id.showBtn);
    showButton.setOnClickListener(new View.OnClickListener() {
    @Override
    public void onClick(View v) {
    showRewardedAd();
    }
    });
    }

    private void loadRewardedAd() {
    if (!rewardedVideoAd.isLoaded()) {
    rewardedVideoAd.loadAd(this.getString(R.string.temp_rewardedID), new AdRequest.Builder().build());
    /*AdRequest request = new AdRequest.Builder()
    .addTestDevice("33BE2250B43518CCDA7DE426D04EE231") // An example device ID
    .build();

    rewardedVideoAd.loadAd(this.getString(R.string.temp_rewardedID), request);*/
    }
    }

    private void showRewardedAd() {
    if (rewardedVideoAd.isLoaded()) {
    rewardedVideoAd.show();
    }
    }

    @Override
    public void onRewardedVideoAdLoaded() {
    statusText.setText("Ad has been loaded");
    }

    @Override
    public void onRewardedVideoAdOpened() {

    }

    @Override
    public void onRewardedVideoStarted() {

    }

    @Override
    public void onRewardedVideoAdClosed() {
    loadRewardedAd();
    statusText.setText("Ad has been Closed");
    }

    @Override
    public void onRewarded(RewardItem rewardItem) {
    Toast.makeText(this, "User has been Rewarded : " + rewardItem.getAmount() * 10, Toast.LENGTH_SHORT).show();
    }

    @Override
    public void onRewardedVideoAdLeftApplication() {

    }

    @Override
    public void onRewardedVideoAdFailedToLoad(int i) {
    statusText.setText("Failed to Load Ad");
    }

    @Override
    protected void onPause() {
    rewardedVideoAd.pause(this);
    super.onPause();
    }

    @Override
    protected void onResume() {
    rewardedVideoAd.resume(this);
    super.onResume();
    }

    @Override
    protected void onDestroy() {
    rewardedVideoAd.destroy(this);
    super.onDestroy();
    }
    }

  • Kaka Zehan

    please guidance, if I make my own application and include video reward ads, can I watch alone or have to be the same with others? and is it okay to download after the ads finish?

  • Jawad Zulqarnain

    Hi there..,
    I'm getting ad failed to be loaded every time when i run the app…
    can u help me with this..
    i followed all of your code..

  • Liran Barsisa

    How can I check if the user got rewarded, even if he uninstalled&re-installed the app?
    Is there an API for this? Maybe even know when was the last time he got rewarded? Or even history of rewards?
    For example, I'd like to reward the user of watching a video, by removing banners.

  • Jamie Elliot

    Hi, in game with test ads i notice rewarded videos can be shown all the time! but when using real ad unit ID in game how often can a rewarded video be shown? is there a set amount of time an ad can be viewed and how often? thank you

  • Parvesh Dhull

    I read admob policy but there is not info about these things , Please you tell me about them.
    1. How many reward videos let watch one user?
    2. How many banner ad can be on screen?
    3. How many time should between two interstital videos?

  • derkatwork33

    What are the rates per rewarded video? Is it based on number of active daily users? Is there a general formula to use to calculate what a rough income would be? It’s critical to know before making the decision to develop.

  • Collins Ani

    Good day.
    Am creating an app, and would like to monetize my app by using rewarded videos, I would like to know how much I would get paid for every video my users watch. Also, watching videos and visiting website from my app, is this referred to as cpc ?

  • Nayeem Ahmed

    Hello,
    I am new in AdMob. Do you have any rules like one user can't watch more than 10 ads per day or something like that?

  • Lets Learn

    Can I single ads units( Bannner,interstitial ) in multiple apps . Or Make the mulitple ads units ( Bannner,interstitial ) for multiple apps .Please give reply.

  • zeeshan ashraf

    I Search a lot about it but failed than when I run reward video ad it shows error 3 In #onRewardedVideoAdFailedToLoad please help.
    public class Main2Activity extends AppCompatActivity implements RewardedVideoAdListener {
    private RewardedVideoAd mRewardedVideoAd;
    Button button;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main2);
    button=findViewById(R.id.rewardid);

    MobileAds.initialize(this, "ca-app-pub-3940256099942544/5224354917");
    mRewardedVideoAd = MobileAds.getRewardedVideoAdInstance(this);
    mRewardedVideoAd.setRewardedVideoAdListener(this);
    loadRewardedVideoAd();

    button.setOnClickListener(new View.OnClickListener() {
    @Override
    public void onClick(View v) {
    if(mRewardedVideoAd.isLoaded())
    {
    mRewardedVideoAd.show();
    }

    }
    });
    }

    private void loadRewardedVideoAd() {

    mRewardedVideoAd.loadAd("ca-app-pub-3940256099942544/5224354917",
    new AdRequest.Builder().build());
    }

    @Override
    protected void onDestroy() {
    mRewardedVideoAd.destroy(this);
    super.onDestroy();
    }

    @Override
    protected void onPause() {
    mRewardedVideoAd.pause(this);
    super.onPause();
    }

    @Override
    protected void onPostResume() {
    mRewardedVideoAd.resume(this);
    super.onPostResume();
    }

    @Override
    public void onRewardedVideoAdLoaded() {
    Toast.makeText(this, "onRewardedVideoAdLoaded", Toast.LENGTH_SHORT).show();

    }

    @Override
    public void onRewardedVideoAdOpened() {
    Toast.makeText(this, "onRewardedVideoAdOpened", Toast.LENGTH_SHORT).show();
    }

    @Override
    public void onRewardedVideoStarted() {
    Toast.makeText(this, "onRewardedVideoStarted", Toast.LENGTH_SHORT).show();
    }

    @Override
    public void onRewardedVideoAdClosed() {
    Toast.makeText(this, "onRewardedVideoAdClosed", Toast.LENGTH_SHORT).show();
    }

    @Override
    public void onRewarded(RewardItem rewardItem) {
    Toast.makeText(this, "onRewarded", Toast.LENGTH_SHORT).show();
    }

    @Override
    public void onRewardedVideoAdLeftApplication() {

    }

    @Override
    public void onRewardedVideoAdFailedToLoad(int i) {
    //Toast.makeText(this, "onRewardedVideoAdFailedToLoad", Toast.LENGTH_SHORT).show();
    Toast.makeText(this, i+"", Toast.LENGTH_SHORT).show();
    }

    @Override
    public void onRewardedVideoCompleted() {
    Toast.makeText(this, "onRewardedVideoCompleted", Toast.LENGTH_SHORT).show();
    }
    }

  • Technically Non-Tech

    Im getting error code: 3 even in case of test id. Doesnt AdMob even have any test ads in store for us? How are we supposed to test the app then?

  • Sözde Bilim

    Hello, thank you.
    Does Admob follow a decreasing value after admitting the admob?

    For example, 5 coins won by the user fell to 4, admob follow and know this?

    Or does Admob advertise the tokens after the ad is viewed?

    I want to save (amountPrize) with sharedprefferens and reduce it as user uses. Then I want to show the advertisement again.
    Is it a problem? in terms of policy.

  • Studio Scientific Facts

    Is it legal to use RewardedVideo without giving any reward to the user.. i am desiging an app which does not contain any reward points

  • nanda zulhija

    In test mode its working, but when i change to my real App-ID and Ad-Unit-Id. People who using my apps doesn't see ads. When i figured out, it was failed load, method "onRewardedVideoAdFailedToLoad" was called. i have follows this steps

  • Ste Li

    How to apply rewarded video to android in two different activities, independent of one another (different mini games)? Including the need to use children tags.

    Is it correct to make MobileAds.initialize in the launch of the first activity?

    And request? One static request, before initialization? For children tag using before initialization ..

    And what to do with loading the next video immediately after viewing? After all, if you do not do this each time, you have to wait a long time for the next video, and if you make loading, and the player switches to another activity, the video will remain unused and apparently it makes errors. Help me please. Thank you in advance!

  • Bikash Kalita

    Can you help me?

    Google disabled my adsense account for policy violation. But I feel that this decision was made in error. So I filled the appeal form. But after a few seconds they replied that the publisher id i gave is not valid. But i entered the correct publisher id. It was stored in my emails received from google admob.

    Now what should i do? Please help me anybody.

  • alexis kruguer

    Hi, im programing a game with instertitial and video rewarded ads.

    I wanna know if there is a limit of Instertitial or videos that a single user can request per hour/day.

    I dont wanna break the policies or be catalogued as invalid activity; i searched for it but i didnt get any specific limit.

    (Sorry is i have any mistake in language)

    Greetings from argentina

  • Star Fluttershy

    i followed the tutorial and for me it worked fine.

    for example this is my app: https://play.google.com/store/apps/details?id=com.StarFalls.Break

Leave a Reply

Your email address will not be published. Required fields are marked *