三星 Galaxy Tab 中的 Admob

发布于 2024-11-26 20:53:54 字数 103 浏览 1 评论 0原文

我有一个带有 admob 横幅的应用程序,它在 Android SDK 模拟器中运行良好,但是当我在 Galaxy 选项卡中测试它时,admob 横幅不会出现... 但它确实显示在模拟器中..

I'm have an app with admob banner in it, it works fine in Android SDk emulator, but when i test it in my Galaxy tab, the admob banner doesn't come up...
but it does show in emulator..

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

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

发布评论

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

评论(4

错爱 2024-12-03 20:53:55

因为admob横幅的高度...

对于Android平板电脑,Admob的大小为90dp高度

在我的应用程序上,如果我更改admob的高度,那么在平板电脑上就可以了。

Because the height of the admob banner...

For Android Tablet, the size of the Admob is 90dp for height

On my app, if I change the height of admob, then it's ok on Tablet.

心安伴我暖 2024-12-03 20:53:54

我不知道你是否已经弄清楚了,但我也遇到了同样的问题(当然,我们这里谈论的是旧的 7 英寸 Tab);我注意到 AdSize.BANNER 有效,AdSize.IAB_BANNER 不能纵向显示,只能横向显示;当我手动将广告的宽度设置为600(这是实际宽度)时,它仍然不显示。

因此,查看了文档和指南,并根据指南 :

无论请求的 AdView 的大小如何,SDK 都会请求
实例化为.如果设备屏幕上没有足够的空间
要显示广告,则不会显示任何内容。

那么,根据文档,为什么 AdSize.IAB_BANNER 的宽度为 468 时却无法正常工作呢?这是因为 AdMob 在顶部应用密度计算,并且该标签高密度,横幅大小乘以 1.5,实际大小为 702,超过 600,因此不会显示任何内容。

您可以手动设置宽度为 400,然后它将以适合的尺寸填充广告,即尺寸为 Adsize.BANNER 的横幅。

I don't know if you figured it out yet, but i've come upon the same problem (we are talking the old 7 inch Tab here of course); I noticed that AdSize.BANNER works, AdSize.IAB_BANNER doesn't show in portrait, only in landscape; when I manually set the width of the Ad to 600 (which is the actual width), it still doesn't show.

Therefore looked at the docs and guide, and according to the guide:

The SDK will request whatever size the requesting AdView was
instantiated with. If there isn't enough space on the device's screen
to display the ad, nothing will be shown.

So why doesn't the AdSize.IAB_BANNER work while its 468 wide according to the documentation? It is because AdMob applies density calculations on top, and since the Tab is high density, banner size gets multiplied by 1.5 such that the actual size is 702, which exceeds 600 and thus nothing will get shown.

You can manually set a width of 400, then it will fill the Ad with what size it can fit, being a banner of size Adsize.BANNER.

め可乐爱微笑 2024-12-03 20:53:54

您是否下载了 Samsung Galaxy Tab SDK 并使用该模拟器运行了该项目?无论如何,我认为您的问题与不同的屏幕分辨率有关。尝试在更宽的屏幕上运行您的 Android 模拟器,您也将能够在您的开发环境中重现该问题。

否则,请在您的问题中添加一些代码。

格尔

Did you download Samsung Galaxy Tab SDK and ran the project with that emulator?. In any ways, i think your problem is related to different screen resolutions. Try to run your Android emulator in a wider screen and you will be able to reproduce the problem on your development environment too.

Otherwise, please add some code to your question.

Ger

梦里兽 2024-12-03 20:53:54

这里很难回答。您可以发布您的代码片段吗?

我猜您正在使用测试设备作为模拟器。如果是这样,请添加具有正确设备 ID 的测试设备。

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

希望这会对您有所帮助。

It's difficult to answer here. can you please post your code snippet.

I guess you are using test device as emulator. If so please add test device with a proper device id.

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

Hope this will help you.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文