Integrate with Enhance - Native Android
Banner Ads
Banner is a rectangle filled with an advertising content, displayed on the screen without interrupting the flow of your app.
Example Usage
// Toggle the banner ad if (isBannerVisible) { Enhance.hideBannerAd(); isBannerVisible = false; } else if (Enhance.IsBannerAdReady()) { // The ad is ready, show it Enhance.showBannerAdWithPosition(Enhance.Position.TOP); isBannerVisible = true; }
Methods
Enhance.isBannerAdReady
boolean Enhance.isBannerAdReady()
Return Value:
Returns true
if any ad is ready, false
otherwise. When app is not Enhanced, always returns true
.
Enhance.isBannerAdReady
boolean Enhance.isBannerAdReady(
String placement
)
Parameters:
String placement
- Specifies the internal placement of the ad (from the Enhance mediation editor).
Return Value:
Returns true
if any ad is ready, false
otherwise. When app is not Enhanced, always returns true
.
Enhance.showBannerAdWithPosition
void Enhance.showBannerAdWithPosition(
Enhance.Position position
)
Parameters:
Enhance.Position position
- Specifies the position of this ad on the screen. See the Properties section for the values you can use.
Enhance.showBannerAdWithPosition
void Enhance.showBannerAdWithPosition(
String placement,
Enhance.Position position
)
Parameters:
String placement
- Specifies the internal placement of the ad (from the Enhance mediation editor).
Enhance.Position position
- Specifies the position of this ad on the screen. See the Properties section for the values you can use.
Enhance.hideBannerAd
void Enhance.hideBannerAd()
Properties
String Enhance.PLACEMENT_DEFAULT
The default internal placement of all ad types. Always equal to "default"
.
Enhance.Position.TOP
Indicates that the banner will be shown on the top of the screen.
Enhance.Position.BOTTOM
Indicates that the banner will be shown on the bottom of the screen.