question

Simplify Now, LLC avatar image
Simplify Now, LLC asked

Bug with SIZE_AUTO - ad is partially cut off

It appears that Amazon Ads selects the wrong ad size in landscape mode sometimes, because it doesn't properly measure the height of the available space (is it just checking the width?). I found a reference that for tablets (unless the space is 1024dp wide), the height must be 79. That's fine and the ads display correctly on those devices. However, on phones (e.g 'normal' mdpi or hdpi devices) the space I leave for the ad is still 50dp. In these cases, portrait mode works fine and loads the 320x50 ad. In landscape mode, the ad is fullscreen width, but the bottom is cut off. The expected behavior in this case is to load and center a 320x50 ad (or anything else you want to fit into 50dp high). The same behavior is seen when using the SIZE_320x50 size as well. The SDK seems to be scaling based on the width, with no regard to available height. I am creating this ad in code, using code in onCreate that is similar to that found in your "Loading Ads from Multiple SDKs" page. A different app doesn't appear to be showing this issue (using an earlier version of the SDK and using layouts to create the ad unit).
mobile ads
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Pedro avatar image
Pedro answered
Im having this issue regarding 320_50 also. I force this size when creating the banner, but sometimes the ad gets a much greater height (around 100px), which screws up all my design (makes some part of the game unreachable/invisible). And, also, the width used is much greater: it uses the full width, which is 800px on my test device, while I asked for 320px.
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Simplify Now, LLC avatar image
Simplify Now, LLC answered
This bug isn't fixed in the latest ads SDK (5.1.153). My current 'good enough' solution is to constrain the width (and height) of the layout that contains the ad, and ensure it has enough room for the given size (e.g. for large devices, 90dp rather than 50dp high; only limit to 320dp wide on normal devices, etc.). This results in wasted space, but I can't allow a dynamically sizing ad unit right now. It's also still not perfect, as Amazon still sometimes sneaks a cut-off ad in on me for some devices.
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.