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

Inherits AdPlacement.


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 AdPlacement.DisplayOptions displayOptions) throws MMException
void setListener (InterstitialListener interstitialListener)
boolean isReady ()
boolean hasExpired ()
CreativeInfo getCreativeInfo ()
synchronized void destroy ()
boolean isDestroyed ()

Static Public Member Functions

static InterstitialAd createInstance (String placementId) throws MMException
static void requestBid (final String placementId, InterstitialAdMetadata metadata, final BidRequestListener bidRequestListener) 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

§ createInstance()

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

§ destroy()

synchronized void destroy ( )

Destroys the internal components of the ad. If the ad is in a loading state the destroy will happen after the loading completes.

After the ad has been destroyed it can no longer be used to make requests and all public API methods called will fail with a message outputted to the logs. Remove all references to this placement and create a new placement to make a new ad request.

§ getCreativeInfo()

CreativeInfo getCreativeInfo ( )

Retrieves a CreativeInfo object, containing the creativeId and demandSource.

the CreativeInfo object.

§ hasExpired()

boolean hasExpired ( )

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

true if the ad content is expired, false otherwise

§ isDestroyed()

boolean isDestroyed ( )

Determines if the ad placement has been destroyed.

true if destroyed, false otherwise

§ isReady()

boolean isReady ( )

Returns true if the InterstitialAd is ready to be shown.

true if ready, false otherwise

§ load()

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

§ requestBid()

static void requestBid ( final String  placementId,
InterstitialAdMetadata  metadata,
final BidRequestListener  bidRequestListener 
) throws MMException

Requests a bid and returns it to the BidRequestListener

placementIdidentifier of the placement that is used by the server for selecting ad content
metadatathe metadata to be included in the request for this InterstitialAd bid
bidRequestListeneran instance of BidRequestListener that will be called in response to the bid request

§ setListener()

void setListener ( InterstitialListener  interstitialListener)

Sets the InterstitialListener to receive ad event callbacks.

interstitialListenerthe InlineListener to set. Callbacks will be invoked when ad events occur.

§ show() [1/2]

void show ( final Context  context) throws MMException

Shows the previously loaded interstitial ad content.

contextcontext used for displaying ad content

§ show() [2/2]

void show ( final Context  context,
final AdPlacement.DisplayOptions  displayOptions 
) throws MMException

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

contextcontext used for displaying ad content
displayOptionsan instance of AdPlacement.DisplayOptions