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:
Banner ad guidance: 300x250 - Google AdMob Help.
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.
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.
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
you can use FULL_WIDTH
example ads:adSize="FULL_WIDTHx50"
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With