Center alignment of banner ads with admob mediation.

883 views
Skip to first unread message

Sunho KIM

unread,
Jan 4, 2018, 6:39:03 PM1/4/18
to Google Mobile Ads SDK Developers
Dear Admob Team.


Hello.

I am a developer of Cleveni Inc. headquartered in S. Korea.

I started using admob mediation and I think it is the best mediating solution.


But I found a problem that must to be improved related to banner ads.

Some ads networks such as MoPub have 320x50 size banner.
( Only '320dp'. It is not expandable horizontally. Its width is not be adjusted to fit the screen size. )


But some devices' screen width is greater than 320dp.

In this device(e.g. Nexus 6p), the MoPub banner mediated by Admob Mediation is located to the left, not aligned to the center.


I setted the size of banner view .........

admobBannerView.setAdSize(AdSize.SMART_BANNER);

or

admobBannerView.setAdSize(new AdSize(screenWidth, 50));



Both of the options above have that problem.

I want to align the banner view to the center.

Would you investigate this problem?


Happy New Year !

Thank you for your efforts.


Best Regards,

Cleveni
Sunho KIM

Ivan Bautista (Mobile Ads SDK Team)

unread,
Jan 5, 2018, 2:16:30 AM1/5/18
to Google Mobile Ads SDK Developers
Hi Sunho,

We're glad that you have chosen AdMob for mediation and thank you for your kind words.

Please note that as per the mediation guide for MoPub, Smart Banners are not supported (unchecked) for MoPub which is probably why it is not displaying properly on your end. That said, you can opt to use other supported Ad Networks that supports Smart Banners such as FAN.

Otherwise, if you just want to display regular 320 x 50 Banner Ads and have it center-aligned horizontally, then I suggest that you just use AdSize.BANNER and set it's layout_centerHorizontal property to true similar to the AdView's xml definition in the BannerExample app.

Regards,
Ivan Bautista
Mobile Ads SDK Team

Sunho KIM

unread,
Jan 5, 2018, 5:57:08 AM1/5/18
to Google Mobile Ads SDK Developers
Hi Bautista,

Thanks you for your reply.

I would like to thank you & Admob team very much again for developing Admob mediation.


I tried using AdSize.BANNER but the width of other banners such as Admob, FAN are set to 320dp.

So the banners supporting SmartBanner became more inefficient because it does not fill the width of the screen.

Therefore I have to exclude ad networks that have only 320x50dp size banner (do not support SmartBanner) for considering UI. 

And the effect of mediation would falls accordingly.


It is just my opinion that it would be better if you make the subview aligned to center when

com.google.android.gms.ads.mediation.MediationBannerListener.onAdLoaded();

called.



And I have one more comment about FAN banner mediation adapter.

We cannot set the refresh interval of FAN banner since Nov, 2017.

The form has been disappeared from their website.

Therefore, the cycle of refresh was not able to be controlled by Admob mediation.

Would you like to add a line of code to next version of FaceBookAdapter.java ?

mAdView.disableAutoRefresh();  (mAdView is Facebook Banner AdView)


Thank you for reading the long article.

And have a good weekend :)


Cleveni
Sunho KIM




2018년 1월 5일 금요일 오후 4시 16분 30초 UTC+9, Ivan Bautista (Mobile Ads SDK Team) 님의 말:

Ivan Bautista (Mobile Ads SDK Team)

unread,
Jan 8, 2018, 2:55:49 AM1/8/18
to Google Mobile Ads SDK Developers
Hi Sunho,

Thank you again for the kind words.

Please note that as per this sectionAdSize.BANNER is equivalent to 320x50 dp so if you set your Ad Request with this Banner Size, then only Banner Ads with 320x50 dp size will be returned and no Smart Banner Ads for a particular Ad Unit. That said, if you wish to display Smart Banner Ads only for a particular Ad Unit, then just include Ad networks that support Smart Banners. Otherwise, if you just want to display 320 x 50 Banner Ads and have it center-aligned horizontally, then just use AdSize.BANNER and set it's layout_centerHorizontal property to true as mentioned earlier.

As for the automatic refresh rate for Banner Ads, you can actually modify and disable it in your AdMob dashboard if you need to.

I hope this helps. Feel free to get back to us if you have any other technical concerns about the Mobile Ads SDK.
Reply all
Reply to author
Forward
0 new messages