Dash Stats Docs


public class InterstitialBuilder

Convenience class used to configure and show interstitials. Its methods can be chained together, e.g.:



public static InterstitialBuilder create()
public AdId getAdId()
Returns:The current AdId set by setAdId(AdId).
public String getAnalyticsString()
Returns:The current analytics string set by setAnalyticsString(String).
public InterstitialListener getListener()
Returns:The current InterstitialListener set by setListener(InterstitialListener).
public ScreenType getScreenType()
Returns:The current ScreenType set by setScreenType(ScreenType).
public boolean maybeShow(Context context)

Shows an interstitial at certain times. Our algorithm determines the frequency optimized for the highest click through rate. The interstitial is only shown when there is an internet connection.


true if the interstitial was shown

public InterstitialBuilder preload(Context context)

Loads an interstitial, which can then later be shown using show(Context) or maybeShow(Context). Calling this method is optional.

public InterstitialBuilder setAdId(AdId adId)

Set the AdId for this interstitial, used to track different interstitials in your app.

public InterstitialBuilder setAllowedToUseMediation(boolean allowedToUseMediation)

Set to false to make sure this interstitial will not use mediation, even if mediation is enabled for its AdId. Default value is true.

public InterstitialBuilder setFinishOnExit(Activity activity)

Finish this Activity when the interstitial is closed. This sets the InterstitialListener internally, so can not be used in combination with setListener(InterstitialListener).

public InterstitialBuilder setListener(InterstitialListener listener)

Set a listener for open, close and click events of the interstitial.

public InterstitialBuilder setScreenType(ScreenType screenType)

Set whether to show the interstitial and offerwall in full screen or as a dialog. The default is ScreenType.DIALOG. Note that a dialog is only used when opening the interstitial from an Activity that is not finishing.

public boolean show(Context context)

Shows the interstitial if there is an internet connection.


true if the interstitial was shown