Admob in landscape view

Ditulis oleh: -
If you are using admob and use size as banner, it works fine in portrait mode. But in landscape mode, the advertisement will be only half filling in landscape mode. And in larger phones, even portrait modes will not show full sized ad.

To overcome this, we should use SMART_BANNER size. And make sure that the width and height of adview are wrap_content.

So here is the xml file to use adview.

 <com.google.ads.AdView  
android:id="@+id/adView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
ads:adSize="SMART_BANNER"
ads:adUnitId="a150cabf1100e53"
ads:loadAdOnCreate="true"
/>

Once these changes are made to xml file, your app will show full size ads, in phones of all sizes and in landscape and portrait view.