为什么只有我的测试广告在 AdMob 上有效?

发布于 2024-12-25 08:41:18 字数 537 浏览 0 评论 0原文

我有一个尝试在其上放置广告的应用程序。该应用程序尚未发布(不确定这是否会产生影响)。当我尝试添加广告时,它在测试模式下运行良好。在我的示例中删除第 3 行后,我希望得到一个适当的广告,但我什么也没得到。查看 LogCat,我可以看到我有一个广告请求。

    mAd = new AdView(this, AdSize.BANNER, "<my publisher id>");
    AdRequest ad = new AdRequest();
    ad.addTestDevice("<my phone id>");
    System.out.println(ad.isTestDevice(this));
    mAd.loadAd(ad);

LogCat: 01-08 21:26:57.982: I/Ads(7787): adRequestUrlHtml: .......

我还需要做什么才能看到真正的广告吗?如果我的应用程序未发布,我真的可以看到真正的广告吗?我仍在我的开发手机上从 eclipse 运行该应用程序。

谢谢。

I have an app I have trying to place adverts on. The app is not yet published (not sure if this makes a difference). When I am trying to add an advert it was working perfectly in test mode. Once I removed line 3 in my example, I expected to get a proper advert but I get nothing. Looking at LogCat I can see I have a request for the advert.

    mAd = new AdView(this, AdSize.BANNER, "<my publisher id>");
    AdRequest ad = new AdRequest();
    ad.addTestDevice("<my phone id>");
    System.out.println(ad.isTestDevice(this));
    mAd.loadAd(ad);

LogCat: 01-08 21:26:57.982: I/Ads(7787): adRequestUrlHtml: .......

Is there anything else I need to do to see a real advert? Can I actually see a real advert if my app is unpublished? I am still running the app from eclipse onto my development phone.

Thanks.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

幼儿园老大 2025-01-01 08:41:18

根据我的经验,您只需等到第一个真正的广告出现即可。当您在 AdMob 上创建新的“网站/应用程序”时,可能需要一段时间。

注意:AdMob 第一次看到您的发布商 ID 时,最多可能需要两分钟才能收到广告。每次 ID 超过 24 小时未使用时,最初的两分钟延迟都会重复出现。

来源:http://code.google.com/mobile/ads/docs/android/fundamentals.html

滚动到底部

希望有帮助:)

编辑:
我建议,只需打开包含广告的活动,然后将手机放在桌子上,直到出现某些内容。

In my experience you just have to wait until the first real ad shows up. When you create a new "website/application" on AdMob, it can take a while.

Note: The very first time AdMob sees your publisher ID it may take up to two minutes to receive an ad. This initial two minute lag will recur every time the ID goes unused for 24 hours.

Source: http://code.google.com/mobile/ads/docs/android/fundamentals.html

scroll to the bottom

Hope it helps :)

Edit:
I would recommend, just open the Activity which contains the ad and let the phone lie on the table until something shows up.

撩心不撩汉 2025-01-01 08:41:18

对于真实/实时广告

摘自:http: //code.google.com/mobile/ads/docs/android/fundamentals.html

 AdView adView = new AdView(this, AdSize.BANNER, MY_AD_UNIT_ID);
// Lookup your LinearLayout assuming it’s been given
// the attribute android:id="@+id/mainLayout"
LinearLayout layout = (LinearLayout)findViewById(R.id.mainLayout);
// Add the adView to it
layout.addView(adView);
// Initiate a generic request to load it with an ad
adView.loadAd(new AdRequest());

另外,请注意:

  • 他们可能需要一些时间才能开始进入。很少见,但可能一天,最初。

  • 登录您的 admob.com 帐户并确保其显示通信处于活动状态。

测试模式

启用 Admob 测试广告的最佳做法:

http://code.google.com/mobile/ads/docs/bestpractices.html#testmode

AdRequest adRequest = new AdRequest();
adRequest.addTestDevice(AdRequest.TEST_EMULATOR);               // Emulator
adRequest.addTestDevice("TEST_DEVICE_ID");                      // Test Android Device

For Real/Live Ads

Taken from: http://code.google.com/mobile/ads/docs/android/fundamentals.html

 AdView adView = new AdView(this, AdSize.BANNER, MY_AD_UNIT_ID);
// Lookup your LinearLayout assuming it’s been given
// the attribute android:id="@+id/mainLayout"
LinearLayout layout = (LinearLayout)findViewById(R.id.mainLayout);
// Add the adView to it
layout.addView(adView);
// Initiate a generic request to load it with an ad
adView.loadAd(new AdRequest());

Also, Take Note:

  • It may take some time for them to start coming in. Rarely, but possibly a day, initially.

  • Login to your admob.com account and make sure it shows communication is active.

For Test Mode

Best Practices for enabling Admob Test Ads:

http://code.google.com/mobile/ads/docs/bestpractices.html#testmode

AdRequest adRequest = new AdRequest();
adRequest.addTestDevice(AdRequest.TEST_EMULATOR);               // Emulator
adRequest.addTestDevice("TEST_DEVICE_ID");                      // Test Android Device
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文