Triton Mobile SDK for Android
Classes | Public Member Functions | Static Public Member Functions | Static Public Attributes | List of all members
com.tritondigital.ads.AdLoader Class Reference

Loads an ad from an ad request. More...

Classes

interface  AdLoaderListener
 A listener for receiving AdLoader notifications. More...
 

Public Member Functions

void cancel ()
 Cancel the current loading.
 
Bundle getAd ()
 Returns the loaded ad.
 
int getError ()
 Returns the error code.
 
AdLoaderListener getListener ()
 Returns the ad loader listener.
 
void load (AdRequestBuilder adRequestBuilder)
 Load an ad request from its builder.
 
void load (AdRequestBuilder adRequestBuilder, Map< String, List< Integer > > dmpSegments)
 Load an ad request from its builder with DMP Segments.
 
void load (String adRequest)
 Load an ad request. More...
 
void load (String adRequest, Map< String, List< Integer > > dmpSegments)
 Load an ad request. More...
 
void setListener (AdLoaderListener listener)
 Sets the ad loader listener.
 

Static Public Member Functions

static String debugErrorToStr (int errorCode)
 Converts the error codes to a string. More...
 

Static Public Attributes

static final int ERROR_NETWORK_NOT_AVAILABLE = 8054
 Network not available.
 
static final int ERROR_NO_INVENTORY = 8004
 No ad available.
 
static final int ERROR_UNKNOWN = 8003
 Unspecified error.
 
static final int ERROR_UNKNOWN_HOST = 8001
 Unknown host.
 

Detailed Description

Loads an ad from an ad request.

Member Function Documentation

◆ debugErrorToStr()

static String com.tritondigital.ads.AdLoader.debugErrorToStr ( int  errorCode)
static

Converts the error codes to a string.

Note
Only use for debugging purpose.

◆ load() [1/2]

void com.tritondigital.ads.AdLoader.load ( String  adRequest)

Load an ad request.

If this class is already loading an ad, it will be cancelled.

◆ load() [2/2]

void com.tritondigital.ads.AdLoader.load ( String  adRequest,
Map< String, List< Integer > >  dmpSegments 
)

Load an ad request.

If this class is already loading an ad, it will be cancelled.