Android Verizon Ads SDK Standard Edition Documentation  1.8
Classes | Public Member Functions | Static Public Member Functions | List of all members
InlineAdFactory Class Reference

InlineAdFactory is a factory class that handles loading and caching of InlineAdView placements. More...

Classes

interface  InlineAdFactoryListener
 Interface for receiving notifications from the InlineAdFactory. More...
 

Public Member Functions

 InlineAdFactory (final Context context, final String placementId, final List< AdSize > adSizes, final InlineAdFactoryListener adFactoryListener)
 Factory method for creating InlineAdView objects. More...
 
void abortLoad ()
 Aborts any load requests that are still active.
 
void destroy ()
 Frees the internal resources held by the factory. More...
 
List< AdSizegetAdSizes ()
 Provides access to the AdSizes that have been set for the InlineAdFactory. More...
 
String getPlacementId ()
 Get the placementId for the InlineAdFactory. More...
 
RequestMetadata getRequestMetadata ()
 Provides access to the RequestMetadata that has been set for the InlineAdFactory. More...
 
void load (final Bid bid, final InlineAdView.InlineAdListener inlineAdListener)
 Loads the InlineAdView for the provided bid. More...
 
void load (final InlineAdView.InlineAdListener inlineAdListener)
 Requests a new InlineAdView. More...
 
InlineAdView loadAdFromCache (final InlineAdView.InlineAdListener inlineAdListener)
 Attempts to load a InlineAdView from the cache. More...
 
void prefetch ()
 Initializes a cache replenishment request. More...
 
void setAdSizes (final List< AdSize > adSizes)
 Set the supported AdSizes. More...
 
void setCacheReplenishmentThresholdOverride (final int cacheReplenishmentThresholdOverride)
 Sets the cache replenishment threshold. More...
 
void setListener (final InlineAdFactoryListener adFactoryListener)
 Set the InlineAdFactoryListener to receive ad factory event callbacks. More...
 
void setRequestMetaData (final RequestMetadata requestMetadata)
 Sets a RequestMetadata object that overrides global RequestMetadata for the InlineAdFactory’s ad requests. More...
 

Static Public Member Functions

static void requestBid (final Context context, final String placementId, final List< AdSize > adSizes, final RequestMetadata requestMetadata, final BidRequestListener bidRequestListener)
 Requests a bid for the opportunity to win the InlineAdView impression. More...
 

Detailed Description

InlineAdFactory is a factory class that handles loading and caching of InlineAdView placements.

It uses the InlineAdFactoryListener interface to provide notifications about InlineAdView creation.

Constructor & Destructor Documentation

◆ InlineAdFactory()

InlineAdFactory ( final Context  context,
final String  placementId,
final List< AdSize adSizes,
final InlineAdFactoryListener  adFactoryListener 
)

Factory method for creating InlineAdView objects.

Use this to set the placementId and listener for InlineAdViews that the InlineAdFactory will create.

Parameters
contextthe context in which the InlineAdViews will be displayed
placementIdplacementId that will be set for all InlineAdViews that the InlineAdFactory creates
adSizesall AdSizes supported by the inline placement
adFactoryListenerthe InlineAdFactoryListener that will receive ad factory events for the InlineAdFactory

Member Function Documentation

◆ destroy()

void destroy ( )

Frees the internal resources held by the factory.

The instance cannot be used after this method is called.

◆ getAdSizes()

List<AdSize> getAdSizes ( )

Provides access to the AdSizes that have been set for the InlineAdFactory.

Returns
the AdSizes set for the InlineAdFactory

◆ getPlacementId()

String getPlacementId ( )

Get the placementId for the InlineAdFactory.

Returns
the placementId for the InlineAdFactory

◆ getRequestMetadata()

RequestMetadata getRequestMetadata ( )

Provides access to the RequestMetadata that has been set for the InlineAdFactory.

Returns
the RequestMetadata set for the InlineAdFactory

◆ load() [1/2]

void load ( final Bid  bid,
final InlineAdView.InlineAdListener  inlineAdListener 
)

Loads the InlineAdView for the provided bid.

Parameters
bidthe Bid that will be loaded
inlineAdListenerthe InlineAdView.InlineAdListener that will receive ad events for the InlineAdView

◆ load() [2/2]

void load ( final InlineAdView.InlineAdListener  inlineAdListener)

Requests a new InlineAdView.

Parameters
inlineAdListenerthe InlineAdView.InlineAdListener that will receive ad events for the InlineAdView

◆ loadAdFromCache()

InlineAdView loadAdFromCache ( final InlineAdView.InlineAdListener  inlineAdListener)

Attempts to load a InlineAdView from the cache.

If the cache is empty, null is returned.

Parameters
inlineAdListenerthe InlineAdView.InlineAdListener that will receive ad events for the InlineAdView
Returns
a InlineAdView from the cache or null if the cache is empty

◆ prefetch()

void prefetch ( )

Initializes a cache replenishment request.

Note that if a request is already in progress or the cache is not below the replenishment threshold, no request will be made.

◆ requestBid()

static void requestBid ( final Context  context,
final String  placementId,
final List< AdSize adSizes,
final RequestMetadata  requestMetadata,
final BidRequestListener  bidRequestListener 
)
static

Requests a bid for the opportunity to win the InlineAdView impression.

Parameters
contextthe context in which the InlineAdViews will be loaded
placementIdplacementId that will be set for all InlineAdViews that the InlineAdFactory creates
adSizesthe supported AdSizes
requestMetadatathe RequestMetadata to use for ad requests
bidRequestListenerthe BidRequestListener that will receive bid request events

◆ setAdSizes()

void setAdSizes ( final List< AdSize adSizes)

Set the supported AdSizes.

Parameters
adSizessupported by the placement

◆ setCacheReplenishmentThresholdOverride()

void setCacheReplenishmentThresholdOverride ( final int  cacheReplenishmentThresholdOverride)

Sets the cache replenishment threshold.

If the resulting cache size after an ad is loaded from the cache is less than or equal this value the factory will attempt to replenish the cache. Must be a non-negative integer. Max value is 30

Parameters
cacheReplenishmentThresholdOverridethe cache size threshold for triggering a replenishment

◆ setListener()

void setListener ( final InlineAdFactoryListener  adFactoryListener)

Set the InlineAdFactoryListener to receive ad factory event callbacks.

Parameters
adFactoryListenerthe InlineAdFactoryListener to set. Called when ad factory events occur.

◆ setRequestMetaData()

void setRequestMetaData ( final RequestMetadata  requestMetadata)

Sets a RequestMetadata object that overrides global RequestMetadata for the InlineAdFactory’s ad requests.

Parameters
requestMetadatathe RequestMetadata to use for ad requests