question

Pedro avatar image
Pedro asked

Banner - Wrong Size on HTC One

Hello. I've had report from a user that the Amazon banner is wrongly sized on HTC One. That ruins all the layout, and makes the banner cover part of the gameplay area and other important UI elements. In code I force a 320x50 banner, and in most cases it does indeed give me a banner of that size (although they seem to be a few pixels bigger, it seems there's a border on the banner), but on his case the banner came as full width (1920 pixels) and around 140 pixels high, that covers 16x more area of the screen than what I asked in code! That ruined the gameplay for him (and certainly dozens or hundreds of others that didn't take the time to report to me by email with a screenshot), and earned me a bad review. First: is it a bug and will be fixed? Second: how can I prevent it in code for happening (I mean, *REALLY* forcing the banner to be the size i want)? Here's the relevant part of my code: (Lib version: 5.1.153) amazonAdView = new AdLayout(ctx, com.amazon.device.ads.AdSize.SIZE_320x50); FrameLayout.LayoutParams layoutParams = new FrameLayout.LayoutParams(FrameLayout.LayoutParams.WRAP_CONTENT, FrameLayout.LayoutParams.WRAP_CONTENT, Gravity.CENTER_VERTICAL | Gravity.CENTER_HORIZONTAL); amazonAdView.setLayoutParams(layoutParams); Thanks
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.

Bipin@Amazon avatar image
Bipin@Amazon answered
Can you give the live app name, so that i can see try this code on HTC one and check amazonAdView = new AdLayout(this, AdSize.SIZE_320x50); float scale = this.getApplicationContext().getResources().getDisplayMetrics().density; LayoutParams layoutParams = new FrameLayout.LayoutParams((int) (320 * scale),(int) (50 * scale), Gravity.BOTTOM | Gravity.CENTER_HORIZONTAL); amazonAdView .setLayoutParams(layoutParams);
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
Thanks. I don't have an HTC to test, but I have made the changes in code as suggested, and will release an update in a few days with this change. On the new game being developed I have already created the layout by your suggestion (limiting the width/height), so hopefully it will be working as expected. Thanks again.
10 |5000

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