Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Admob bannner ads not taking full width

Neither test nor live ads are taking full width of the device when using Admob banner ads.

This is the adView that i've declared in my layout xml:

<com.google.android.gms.ads.AdView
        android:id="@+id/adView"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_alignParentBottom="true"
        android:layout_centerHorizontal="true"
        android:gravity="bottom"
        ads:adSize="BANNER"
        ads:adUnitId="@string/banner_ad_unit_id"></com.google.android.gms.ads.AdView>

This is what is rendered:

enter image description here

like image 578
admin 7798 Avatar asked Jan 19 '16 14:01

admin 7798


People also ask

What is size of AdMob banner?

Banner ad guidance: 300x250 - Google AdMob Help.

Why are my banner ads not showing up?

Ads won't show if you haven't integrated the Google Mobile Ads SDK correctly. Is your ad implementation code working properly? Test your implementation code to check that ads can show. You can also use ad inspector to test your app's ad serving.

How do I use AdMob banner ads?

Click Create ad unit. Follow the Google Developers instructions for Android, iOS, or Unity to implement banner ad units in your app code. You will need your app ID and ad unit ID during implementation. This ad unit won't show ads until you've completed this step.


2 Answers

Change

ads:adSize="BANNER"

to

ads:adSize="SMART_BANNER"

Smart Banners are new ad units (as of v6.0.0) that will render screen-wide banner ads on any screen size across different devices in either orientation. Smart Banners help deal with increasing screen fragmentation across different devices by "smartly" detecting the width of the phone in its current orientation, and making the ad view that size.

Read more here

like image 167
AndroidMechanic - Viral Patel Avatar answered Sep 23 '22 14:09

AndroidMechanic - Viral Patel


you can use FULL_WIDTH

example ads:adSize="FULL_WIDTHx50"

like image 36
ARR.s Avatar answered Sep 23 '22 14:09

ARR.s