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

Inherits AdPlacement.

Classes

class  AdSize
 
interface  InlineAbortListener
 
class  InlineAdMetadata
 
class  InlineErrorStatus
 
interface  InlineListener
 

Public Member Functions

void request (InlineAdMetadata inlineAdMetadata)
 
void abort (InlineAbortListener inlineAbortListener)
 
void setListener (InlineListener listener)
 
void setRefreshInterval (int interval)
 

Static Public Member Functions

static InlineAd createInstance (String placementId, ViewGroup adContainer) throws MMException
 

Detailed Description

InlineAd is the ad space in your application where rectangular and expandable advertisements (for example: banner, footer) are served. Each InlineAd must have a unique placementId and a valid adContainer.

Ad refreshing is not enabled by default. Call setRefreshInterval to enable it. Set the refresh interval to 0 to disable the ad refreshing.

Use InlineListener to receive ad event callbacks. For example, when an ad is successfully loaded from the server the InlineListener.onRequestSucceeded callback is invoked. The click stats are handled internally.

Member Function Documentation

void abort ( InlineAbortListener  inlineAbortListener)

Attempts to abort an active ad request. Depending on how far the ad request has gotten, the request may still succeed or fail before the abort takes effect.

If the abort is successful then the InlineAbortListener.onAborted callback will be invoked. If the request succeeds or fails then the InlineAbortListener.onAbortFailed callback will be invoked after the InlineListener.onRequestSucceeded or InlineListener.onRequestFailed callback is invoked. If no ad request is in progress at the time abort() is called, then the call is ignored.

static InlineAd createInstance ( String  placementId,
ViewGroup  adContainer 
) throws MMException
static

Constructs an InlineAd instance with a unique placementId and adContainer.

Parameters
placementIdidentifier of the placement that is used by the server for selecting ad content
adContainercontainer that the ad content will be inserted into
Returns
instance of InlineAd or null if an error occurred
Exceptions
MMExceptionif the container is invalid or the SDK is not initialized
void request ( InlineAdMetadata  inlineAdMetadata)

Requests and displays ad content for the current InlineAd instance

Parameters
inlineAdMetadatathe metadata to be included in the request for this InlineAd instance
void setListener ( InlineListener  listener)

Sets the InlineListener to receive ad event callbacks.

Parameters
listenerthe InlineListener to set. Callbacks will be invoked when ad events occur.
void setRefreshInterval ( int  interval)

Sets the refresh interval in milliseconds. If the value is less than the allowed minimum and greater than 0 then the minimum value will be used.

Set to 0 to disable refreshing.

Parameters
intervalthe refresh interval (in milliseconds) to set