How to get test ad Banners and test Interstitial ads working for adMob?

后端 未结 2 630
小蘑菇
小蘑菇 2021-01-21 23:10

I am trying to setup adMob ads. I have two questions:

1) Am I using adListener interface correctly? 2) How come I am unable to see ad Interstitials?

Lets start w

相关标签:
2条回答
  • 2021-01-21 23:36

    Last I looked at admob the interstitial ads were invite only. Meaning they would contact you if they felt your apps were a good fit with that type of advertising.

    0 讨论(0)
  • 2021-01-21 23:43

    OK, several problems here.

    1) No you are not using the AdListener interface correctly. Don't create your own interface. AdMob already supplies an AdListener interface. You do need to implement it however.

    NB personally I would create an anonymous implementation of the AdListener instead of adding it to the Activity, but that's a design design for yourself.

    Next you need to attach your listener to your AdView. So in your #onCreate

    // load banner ads
    adView.setAdListener(new AdListener() {
       ...
    });
    adView.loadAd(adRequestBanner);
    

    2) You are unlikely to see any Interstitials with the code above because you are attempting to display immediately after requesting. It is extremely unlikely that an Interstitial has been downloaded in that short time frame. And in any case you really don't want to display an interstitial every time your Activity is created, it is a poor user experience.

    Move your call to displayInterstitial() to some later point in your app life cycle, such at the end of a game session or between levels etc.

    0 讨论(0)
提交回复
热议问题