Take the 2-minute tour ×

I'm implementing a layout for a small screen device.
For testing I'm using a Huawei Ideos U8150 which has a resolution of 240x320.

Because of the small resolution I have a major space problem. So I thought I could put an AdMob AdView and a TextView inside of a horizontal LinearLayout.
The AdView size would take up 3/4 of the width and the TextView 1/4.

In the graphical layout tool everything looks as expected. But when I run the app on the device it doesn't display an ad inside of the AdView. I made the background of the AdView red so I can confirm that the AdView is actually visible. It just doesn't display ads.

I confirmed with onReceiveAd that I get ads. And I print the frame of the AdView in that method. Which logs as origin: 0,38 width: 180,47. Looks okay for me too.

So I'm wondering if the AdMob AdView is able to resize its ads so they are displayed correctly. Maybe the things I try are just not possible.

That's my layout:

<LinearLayout android:id="@+id/linearLayoutAds" android:background="#F0F0" android:layout_width="fill_parent" android:layout_height="wrap_content" android:orientation="horizontal" android:layout_alignParentTop="true">
share|improve this question
add comment

1 Answer

up vote 4 down vote accepted

Ads won't display if your linearlayout's height becomes less than 50 dp. I have not tried reducing width , but after looking at this thread it looks like its not possible to reduce the width to 180 px.

share|improve this answer
great. At least for the users of tiny devices. They don't see ads :-) Just found that on the AdMob website: "The SDK will request whatever size the requesting AdView was instantiated with. **If there isn't enough space on the device's screen to display the ad, nothing will be shown.**" –  Matthias Bauch Jan 30 '12 at 7:16
AdMob Ads are 320x50dp. Your phone has a resolution of 240x320, but is a low density device(1dp = 0.75 px), so it is really 320x426dp. In portrait mode, AdMob requires the entire width of the screen to display an ad, but in landscape mode, it only needs 3/4 of the width on this device. Take another look at your logs; if you receive an ad, but there is not enough space to show it, the SDK will log a warning saying something like "Not enough space to show ad! Wants<320,50>, Has: <240,377>". –  Eric Leichtenschlag Jan 31 '12 at 0:11
add comment

Your Answer


