Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a way to use a variable ad banner size?

I'm using Android MOB, and I'd like to use different sizes of banners, especially for the larger screen sizes. I'm using XML code to do so. Is there a way I can use XML to make it work? I'd like to use XML so I can just put it as a standard part of my styles for each of the screen sizes. Thanks!

Sample XML Code:

<com.google.ads.AdView android:id="@+id/adView" 
    ads:loadAdOnCreate="true" ads:adSize="BANNER" 
    ads:adUnitId="@string/admob_unit_id" 
    android:layout_width="wrap_content" 
    android:layout_height="wrap_content" 
    android:layout_alignParentTop="true" ></com.google.ads.AdView>
like image 831
PearsonArtPhoto Avatar asked Nov 04 '22 20:11

PearsonArtPhoto


2 Answers

Visit http://developer.android.com/guide/practices/screens_support.html

That contains information about how to create xml for different layouts, based on screen size.

From there it seems like you could then ads:adSize

like image 149
mikeastevenson Avatar answered Nov 14 '22 23:11

mikeastevenson


http://code.google.com/intl/nl/mobile/ads/docs/android/intermediate.html

Google AdMob Ads supports three tablet-only banner sizes in addition to the 320x50 shown on phones: 320x50, 300x250, 468x60, 728x90

like image 33
Bart Blommaerts Avatar answered Nov 14 '22 23:11

Bart Blommaerts