question

kenneth avatar image
kenneth asked

You need an adView.getHeight() feature

I have added your ads in an application and due to the layout I didn't want for force an ad size. Ideally if I could call a getHeight feature to grab the height that Amazon will set the ad according to my width/height it would be sweet. For instance I have a view set up by percents of height. Depending on the device the ad size could be anything and this would be a simple fix. I guess I could make a method to handle it, but why not have it built in.
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.

1 Answer

Bipin@Amazon avatar image
Bipin@Amazon answered
We recommend setting the AdLayout’s height to WRAP_CONTENT to ensure that the ad will scale to fill the entire AdLayout. Alternatively, you can limit the ad’s height by setting it to a device-independent pixel value instead. If your AdLayout is too small then no ad will be returned and ad loading will fail. You can ensure that your AdLayout is large enough for most scenarios by creating a screen-wide AdLayout with its width set to MATCH_PARENT and its height to WRAP_CONTENT. There are few width height ratio. AdSize.SIZE_300x50 AdSize.SIZE_320x50 AdSize.SIZE_300x250 AdSize.SIZE_600x90 AdSize.SIZE_728x90 AdSize.SIZE_1024x50 If you want to configure ads manually: https://developer.amazon.com/sdk/mobileads/understanding-api.html#Manual%20Ad%20Size
10 |5000

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