Question

Background

I wish to show an ad using admob on my app, but I also wish to show there something while it is being loaded (before it's being shown) or maybe even when there is no internet connection.

The problem

It seems that admob has a wide range of sizes for its ads, depending on the screen (link here) you wish to target, but there is no instruction of what you should use for choosing the best size .

For example, they talk about tablets , but they don't define what is a tablet in the table, and of which type. They don't even explain what each of the ad types mean.

The question

Given a device with a specific configuration, how should I choose the best size of the adView?

If I use BANNER, will it always be shown? Will it automatically choose the others in case the screen has enough space?

Was it helpful?

Solution

I'm using different ad sizes for the four different screen sizes (small, normal, large, xlarge). IMO it makes sense to use more screen real estate for ads on larger screens and less on smaller screens but that depends a lot on the app and how much of the screen real-estate you are willing to trade in for larger ads (larger ads = higher revenue). So it's really a question of finding the right balance between usability and maximizing ad revenue. If the ad is too large and too obtrusive, then the usability will suffer and so will the rating and thus the number of downloads. If the ad is very small (BANNER size on an xlarge screen is really very small), users won't even notice and might not click on it.

In order to use different ads formats for different screen sizes I use the include tag to include the ad layout, which I define in the layout folders layout, layout-small, layout-large and layout-xlarge. So each of these folders contains an ad.xml and they have different admob:adSize and admob:adUnitId tags.

I also reserve space on the layout should the ad not load (no network e.g.). The dimensions of the space are the dimensions of the different ad sizes: BANNER: 320*50 IAB_BANNER: 468*60 IAB_LEADERBOARD: 728*90

I define the dimensions in dimens.xml files located in values, values-large and values-xlarge (small uses BANNER too in my apps). The dimensions can be referenced in your layout in the layout_width and layout_height tag like so:

android:layout_width="@dimen/admob_ad_width"
android:layout_height="@dimen/admob_ad_height"

Essentially it's your decision which ad sizes you want to display on what device (Admob will use the defined adSize and not override your configuration). I'm using BANNER for small and normal sized screens, IAB_BANNER for large and IAB_LEADERBOARD for xlarge screens but that decision lies with you. The approach to let Admob decide which size to display isn't a good option for most apps as they should make good use the screen real estate and knowing how large the ad will be helps a lot when it comes to designing the screen layout.

OTHER TIPS

Be sure to use the newly introduced AdMob Adaptive Banners. They don't require adjustments on your side and they utilize all the width available.

Embed them into a FrameLayout like following

<FrameLayout
    android:id="@+id/adFragment"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:layout_alignParentBottom="true"
    android:layout_centerHorizontal="true"
    android:layout_gravity="center|bottom" />

When no banner is loaded layout_height="wrap_content" will be 0, so the FrameLayout will be invisible to the user.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top