The MVP Android Developer Hub

Welcome to the MVP Android developer hub. You'll find comprehensive guides and documentation to help you start working with MVP Android as quickly as possible, as well as support if you get stuck. Let's jump right in!

Get Started    

Introduction

Banners are rectangle ads appearing either at the top or bottom of the screen when the user interacts with your app. The user can view them but cannot dismiss them.

Banners are automatically refreshed by the after 20 seconds.

Important

The refreshes banners automatically. To avoid discrepancies with 's and 3rd-party networks' reporting, any automatic or manual banner refresh settings on 3rd-party network SDKs must be disabled.

Make an Ad Request

Banner sizes must be configured before they are shown. Once you have set the required size, you must make a request to show the banner.

Implement the code below to make an Ad Request:

BannerOptions bannerOptions = new BannerOptions().withNetworkSize(SupportedCreativeSizes.ADMOB_LEADERBOARD).withNetworkSize(SupportedCreativeSizes.FACEBOOK_BANNER_HEIGHT_90);
String placementId = "12345";
Banner.show(placementId, bannerOptions, activity);

Destroying the Banner

Once you have decided that you no longer want to use the banner, you must destroy it.

To destroy the banner, implement the code below:

//destroys the banner for a specific placement
String placementId = "12345";
Banner.destroy(placementId);

Banner Position

By default, the banners are placed at the bottom of your screen.

You can place them at the top by using the code below:

BannerOptions bannerOptions = new BannerOptions().placeAtTheTop();
String placementId = "12345";
Banner.show(placementId, bannerOptions, activity);

BannerOptions bannerOptions = new BannerOptions().placeInContainer(viewGroup);
String placementId = "12345";
Banner.show(placementId, bannerOptions, activity);

Or you can provide your own custom view and place them in there:

BannerOptions bannerOptions = new BannerOptions().placeInContainer(viewGroup);
String placementId = "12345";
Banner.show(placementId, bannerOptions, activity);

Adding Callbacks

The callback code below is required for the SDK to properly track the activity of your ad

Banner.setBannerListener(new BannerListener() {
    @Override
    public void onError(String placementId, BannerError error) {
        // Called when an error arises when showing the banner from placement 'placementId'
    }
 
    @Override
    public void onLoad(String placementId) {
        // Called when the banner from placement 'placementId' is successfully loaded
    }
 
    @Override
    public void onShow(String placementId, ImpressionData impressionData) {
        // Called when the banner from placement 'placementId' is shown
    }
 
    @Override
    public void onClick(String placementId) {
        // Called when the banner from placement 'placementId' is clicked
    }
});

Banner


Suggested Edits are limited on API Reference Pages

You can only suggest edits to Markdown body content, but not to the API spec.