每1分钟插入一次插页式广告 [英] Interstitial Ad Loading After every 1 Minte

查看:93
本文介绍了每1分钟插入一次插页式广告的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想每隔一分钟显示一次插页式广告... 谁能解释一下示例代码...

I want to Display a Interstitial Ad after every one minute... can any one please explain with sample code ...

谢谢 请

    interstitialAds = new InterstitialAd(this, "Your_Pub_ID");
    final AdRequest adRequest = new AdRequest();
    interstitialAds.loadAd(adRequest);
    interstitialAds.setAdListener(this);

推荐答案

有很多方法可以在固定的时间间隔内展示插页式广告.您可以在应用中添加代码,以便在固定的时间间隔内展示插页式广告.

There are numerous way to display Interstitial ads at regular interval of time. You can add codes in your app in order to display Interstitial ads at regular interval of time.

prepareAd();

prepareAd();

    ScheduledExecutorService scheduler =
            Executors.newSingleThreadScheduledExecutor();
    scheduler.scheduleAtFixedRate(new Runnable() {

        public void run() {
            Log.i("hello", "world");
            runOnUiThread(new Runnable() {
                public void run() {
                    if (mInterstitialAd.isLoaded()) {
                        mInterstitialAd.show();
                    } else {
                       Log.d("TAG"," Interstitial not loaded");
                    }

                    prepareAd();


                }
            });

        }
    }, 20, 20, TimeUnit.SECONDS);


但是,我(您可以说admob)强烈阻止您执行此类操作.这违反了AdMob政策,因此您的帐户将被暂停.


However, I (you can say that admob) strongly stopping you to doing such stuffs. It is against AdMob policy and your account will get suspended if you do so.

如果您想了解有关android应用程序开发以及如何在应用程序中放置admob广告的更多信息.我建议您访问此网站.

If you want to learn more stuffs about android app development and how to place admob ad in your application. I recommend you to visit this website.

http://www.elegantespace.com/how-to-load-interstitial-ad-at-regular-interval-of-time/

这篇关于每1分钟插入一次插页式广告的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆