简体   繁体   中英

Admob in Samsung Galaxy Tab

我有一个带有admob横幅的应用程序,它在Android SDk模拟器中可以正常工作,但是当我在Galaxy选项卡中对其进行测试时,admob横幅不会出现...但是它会在模拟器中显示。

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.

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.

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

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 .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM