Banner and MREC ads are rectangular ad formats that occupy part of an app’s layout—often at the top or bottom of the screen or inline in scrollable content. They remain visible as users interact with the app, which allows uninterrupted gameplay or use, and can refresh automatically after a set period.
The following sections show you how to load, show, and hide a banner or MREC ad.
The following code shows you how to load a banner or an MREC by using your Ad Unit ID, desired banner position, and (for banners) desired background color. MAX sizes the ad for you automatically:
MAX automatically sizes banners to 320×50 on phones and 728×90 on tablets.
It sizes MRECs to 300×250 on both phones and tablets.
Use the utility method AppLovinMAX.isTablet() to help with view-sizing adjustments.
To show a banner, call showBanner():
To hide a banner, call hideBanner():
“Why mobile banners ads persist in a video and playable world” from AppLovin’s Blog.