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.

Classes

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
static

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

Parameters
placementIdidentifier of the placement that is used by the server for selecting ad content
Returns
instance of InterstitialAd or null if an error occurred
Exceptions
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.

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

Returns true if the InterstitialAd is ready to be shown.

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

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

InterstitialListener.onLoaded

callback will be invoked.
If the load fails the

InterstitialListener.onLoadFailed

callback will be invoked.

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

Sets the InterstitialListener to receive ad event callbacks.

Parameters
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.

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

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

Parameters
contextcontext used for displaying ad content
displayOptionsan instance of DisplayOptions
Exceptions
MMException