Millennial Media Android Ad SDK Public Documentation  6.3.1
Classes | Public Member Functions | Static Public Member Functions | List of all members
InterstitialAd Class Reference

Inherits AdPlacement.


class  DisplayOptions
class  InterstitialAdMetadata
class  InterstitialErrorStatus
interface  InterstitialListener

Public Member Functions

void load (final Context context, InterstitialAdMetadata interstitialAdMetadata)
void show (final Context context) throws MMException
void show (final Context context, final DisplayOptions displayOptions) throws MMException
void setListener (InterstitialListener interstitialListener)
boolean isReady ()
boolean hasExpired ()

Static Public Member Functions

static InterstitialAd createInstance (String placementId) throws MMException

Detailed Description

InterstitialAd is the ad space in your application which take up the full screen. Each InterstitialAd must have a unique placementId which identifies a particular ad placement.

Once ad content has been loaded using load the callback InterstitialListener.onLoaded will fire. After the load succeeds the ad content can be displayed using show.

Member Function Documentation

static InterstitialAd createInstance ( String  placementId) throws MMException

Constructs an InterstitialAd instance that be used by the integrating developer. Immersive mode is defaulted to false.

placementIdidentifier of the placement that is used by the server for selecting ad content
instance of InterstitialAd or null if an error occurred
MMExceptionif placementId is invalid or the SDK is not initialized
boolean hasExpired ( )

Returns true if the loaded ad content has expired and must be reloaded.

true if the ad content is expired, false otherwise
boolean isReady ( )

Returns true if the InterstitialAd is ready to be shown.

true if ready, false otherwise
void load ( final Context  context,
InterstitialAdMetadata  interstitialAdMetadata 

Loads new ad content for this placement. If the load succeeds the


callback will be invoked.
If the load fails the


callback will be invoked.

contextthe context that will be used for loading new InterstitialAd content
interstitialAdMetadatathe InterstitialAdMetadata object to be used in the request
IllegalArgumentExceptionthrown if context is not a valid Context
void setListener ( InterstitialListener  interstitialListener)

Sets the InterstitialListener to receive ad event callbacks.

interstitialListenerthe InlineListener to set. Callbacks will be invoked when ad events occur.
void show ( final Context  context) throws MMException

Shows the previously loaded interstitial ad content.

contextcontext used for displaying ad content
void show ( final Context  context,
final DisplayOptions  displayOptions 
) throws MMException

Shows the previously loaded interstitial ad content using the provided DisplayOptions.

contextcontext used for displaying ad content
displayOptionsan instance of DisplayOptions