AppBrain Best Android Apps
AppBrain | Docs
  • Apps
  • Statistics
  • Docs
  • Developers
  • Get SDK
  • Sign up
  • Log in

General

  • Introduction
  • Privacy policy
  • About AppBrain
  • HTML widgets
  • Embeddable Android app widgets

Publishers

  • AppBrain SDK
    • Getting started
    • Ad unit overview
    • Banners
    • Interstitial
    • ListView ads
    • Extra features
    • Integration with other SDKs
    • Integration policy
    • Javadoc
      • AdId
      • AdListAdapter
      • AdListAdapter.AdLayoutCreator
      • AdOptions
      • AdOptions.ScreenType
      • AdService
      • AdService.BorderSize
      • AdService.ReturnToAppConfig
      • AdvertiserService
      • AppBrain
      • AppBrainBanner
      • AppBrainBanner.BannerSize
      • AppBrainInitProvider
      • AppBrainUserData
      • AppBrainUserData.Gender
      • BannerListener
      • InterstitialBuilder
      • InterstitialListener
      • InterstitialListener.InterstitialError
      • KeepClass
      • ReferrerReceiver
      • RemoteSettings
  • Resources
  • Terms of service
  • FAQ

Advertisers

  • Resources
  • Terms of service
  • FAQ

Intelligence

  • Insights
  • Subscriptions
  • SDK downloads
  • Phone downloads
  • Terms of service

AppBrain API

  • Using the AppBrain API
  • API specification
  • Pricing
  • Promotion campaigns
  • Reporting
  • AppLinks TOS
Search

InterstitialBuilder

public class InterstitialBuilder

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

InterstitialBuilder.create().setAdId(AdId.EXIT).setFinishOnExit(this).show(this)
Author

AppBrain

Methods

public static InterstitialBuilder create()
public AdId getAdId()
Returns

The current AdId set by setAdId(AdId).

public InterstitialListener getListener()
Returns

The current InterstitialListener set by setListener(InterstitialListener).

public Runnable getOnDoneCallback()
Returns

The current callback set by setOnDoneCallback(Runnable).

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.

Parameters
  • context – the current Context

Returns

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). Note that if you want to use AppBrain mediation, preload() must be called before showing. If you don’t use mediation, preload() 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 setOnDoneCallback(Runnable onDoneCallback)

Set a callback for when the interstitial is done. This is a convenient way to execute certain logic after the interstitial. The callback will be called either when the interstitial is closed, or when the interstitial is not opened (e.g. when maybeShow(Context) returns false).

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.

Parameters
  • context – the current Context

Returns

true if the interstitial was shown

boolean showWithSkipChange(Context context, double skipChance)
Android App Monetization by AppBrain
Interested in monetizing your app?
Monetize my app

More apps

  • Top Android apps being viewed
  • Yomik - Interesting & Chat Android App
  • Lucky168: Gaming Marketplace
  • ATLAS.ti Mobile

Android Statistics

  • Android statistics
  • Google Play Developer stats
  • Trending Android Apps
  • Top popular Apps

About AppBrain

  • Contact
  • Blog
  • Privacy
  • Documentation
  • Articles
  • Top Free Games Apps for your iPhone or iPad
© 2010-2024 - AppBrain