What is the size in pixels of AdSize.BANNER?

In my Android app, I have an AdView:

AdView adView = new AdView(this, AdSize.BANNER, MY_BANNER_UNIT_ID); 

How to get the size of this in pixels?

+8
android admob adview
source share
3 answers

As mentioned in Flynn's answer, adView is 320 dp at 50 dp. To convert 50 dp to pixels do

 (int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, 50, getResources().getDisplayMetrics()); 

(and similarly for 320 dp).

+16
source share

You can use the following methods from the AdSize class to get its size in pixels:

+12
source share

AdView has a size of 320x50, and if the view does not fit, it is not displayed.

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

+7
source share

All Articles