在活动中加载插页式广告

Load Interstitial Ad in anctivity

在我的应用中,集成插页式广告后,广告加载正常。

现在我希望显示广告的 activity 不应在用户每次打开 activity 时都显示广告,否则用户使用该应用程序会很烦人.

对于同一个用户,如果他打开那个 activity 那么这个比率应该假设如果用户打开 activity 5 次那么他应该看到广告 2 次。

这个可以实现吗。好心推荐

如果您使用的是 admob,则可以直接从高级设置下的广告拦截设置中设置费率。这将为您节省编码率的麻烦

在 activity 中声明 public static int count=0; 您打算在 activity 中显示广告的地方

现在输入这段代码

you__activityname_where_count_declare.count++;

if(you__activityname_where_count_declare.count==5)
  {
    you__activityname_where_count_declare.count=0;
    your_ad_method.ShowInterstitialAds();
  }

它会在 5 次访问中显示 1 次广告

打开 AdMob 帐户,您可以从那里设置在特定时间要显示的广告数量