question

maxlys avatar image
maxlys asked

Actual banner ad size set as “AUTO”

Hello, Is it possible to return true banner ad sizes that were substituted in “View” and corresponds to the sizes mentioned in https://developer.amazon.com/public/apis/earn/mobile-ads/android/docs/concepts#Manual%20Ad%20Size when banner ad size is set as “AUTO”? Parameters in AdLayout are as follows: android:layout_width="match_parent" android:layout_height="wrap_content" Thanks! Maxim
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

Ross@Amazon avatar image
Ross@Amazon answered
The height and width of an AdLayout can be determined the same way as any other view by using the OnGlobalLayoutListener once the ad has been loaded and placed on the screen. An example of how to use the OnGlobalLayoutListener can be found here: http://www.sherif.mobi/2013/01/how-to-get-widthheight-of-view.html. Documentation on using an AdListener to determine when the ad has loaded can be found here: https://developer.amazon.com/public/apis/earn/mobile-ads/docs/event-tracking-and-errors.
10 |5000

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