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    

Interstitial

Introduction

Interstitials are static or video ads presented before, during or after the user interacts with your app.

The user can view and then immediately dismiss them. This is a non-rewarded format for the user.

The supports both static and video interstitials.

Important

The speed and stability of a user's internet connections may vary. It is highly recommended to fetch as much in advance of showing an ad as possible. This helps to ensure that all necessary assets are downloaded. For example, you may want to fetch an ad when a level starts or after a previous ad has been shown.

Making the Request

Below is an example of making a request for an Intersitial.

import com.fyber.fairbid.ads.Interstitial;
 
String placementId = "12345";
Interstitial.request(placementId);

Adding Callbacks

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

Interstitial.setInterstitialListener(new InterstitialListener() {
    @Override
    public void onShow(String placementId) {
        // Called when the interstitial from placement 'placementId' shows up. In case the ad is a video, audio play will start here.
    }
 
    @Override
    public void onClick(String placementId) {
        // Called when the interstitial from placement 'placementId' is clicked
    }
 
    @Override
    public void onHide(String placementId) {
        // Called when the interstitial from placement 'placementId' hides. In case the ad is a video, audio play will stop here.
    }
 
    @Override
    public void onShowFailure(String placementId) {
        // Called when an error arises when showing the interstitial from placement 'placementId'
    }
 
    @Override
    public void onAvailable(String placementId) {
        // Called when a interstitial from placement 'placementId' becomes available
    }
 
    @Override
    public void onUnavailable(String placementId) {
        // Called when a interstitial from placement 'placementId' becomes unavailable
    }
});

Example Showing an Ad

The following example checks to see if a is available and if it is, uses the show request to display the ad.

String placementId = "12345";
if (Interstitial.isAvailable(placementId)) {
    Interstitial.show(placementId, context);
}

Stop Requesting An Ad

If a placement is no longer relevant for your user, you can stop requesting it. Continuous requests for placements that are no longer available negatively affect the performance of your placement.

String placementId = "12345";
Interstitial.stopRequesting(placementId);

Important

Use stopRequesting to disable the SDK Auto-Request functionality for a specific placement. If you continue requesting ads for s that are not to be shown, the performance of your placement can be impacted.


Interstitial


Suggested Edits are limited on API Reference Pages

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