public class InterstitialAd extends java.lang.Object implements Ad
Modifier and Type | Field and Description |
---|---|
protected static java.lang.String |
ACTION_INTERSTITIAL_DISMISSED |
protected static java.lang.String |
ACTION_INTERSTITIAL_FINISHED_LOADING |
protected static java.lang.String |
BROADCAST_ACTION |
protected static java.lang.String |
BROADCAST_CREATIVE |
protected static java.lang.String |
BROADCAST_INTENT |
protected static java.lang.String |
BROADCAST_UNIQUE_IDENTIFIER_KEY |
protected static java.lang.String |
MSG_PREPARE_AD_DESTROYED |
protected static java.lang.String |
MSG_PREPARE_AD_LOADING |
protected static java.lang.String |
MSG_PREPARE_AD_READY_TO_SHOW |
protected static java.lang.String |
MSG_PREPARE_AD_SHOWING |
protected static java.lang.String |
MSG_SHOW_AD_ANOTHER_SHOWING |
protected static java.lang.String |
MSG_SHOW_AD_DESTROYED |
protected static java.lang.String |
MSG_SHOW_AD_DISMISSED |
protected static java.lang.String |
MSG_SHOW_AD_EXPIRED |
protected static java.lang.String |
MSG_SHOW_AD_LOADING |
protected static java.lang.String |
MSG_SHOW_AD_READY_TO_LOAD |
protected static java.lang.String |
MSG_SHOW_AD_SHOWING |
Constructor and Description |
---|
InterstitialAd(Context context)
Constructs an InterstitialAd
|
Modifier and Type | Method and Description |
---|---|
int |
getTimeout()
Gets the current timeout value in milliseconds.
|
static boolean |
isAdShowing()
Checks if an InterstitialAd is currently showing to the user.
|
boolean |
isLoading()
Gets whether this Ad is currently being loaded.
|
boolean |
isReady()
Tells whether this InterstitialAd is ready to show.
|
boolean |
isShowing()
Tells whether this InterstitialAd is currently being displayed to the user
|
boolean |
loadAd()
Load a single ad into this InterstitialAd, with no targeting options
Creates a background thread to load a new ad.
|
boolean |
loadAd(AdTargetingOptions options)
Load a single ad into this InterstitialAd
Creates a background thread to load a new ad based on AdTargetingOptions.
|
void |
setListener(AdListener adListener)
Sets the listener used to track ad life-cycle events.
|
void |
setTimeout(int timeout)
Sets the timeout value for loading the ad.
|
boolean |
showAd()
Shows the Ad to the user, if it is ready to show.
|
protected static final java.lang.String BROADCAST_INTENT
protected static final java.lang.String BROADCAST_ACTION
protected static final java.lang.String ACTION_INTERSTITIAL_DISMISSED
protected static final java.lang.String ACTION_INTERSTITIAL_FINISHED_LOADING
protected static final java.lang.String BROADCAST_UNIQUE_IDENTIFIER_KEY
protected static final java.lang.String BROADCAST_CREATIVE
protected static final java.lang.String MSG_PREPARE_AD_DESTROYED
protected static final java.lang.String MSG_PREPARE_AD_SHOWING
protected static final java.lang.String MSG_PREPARE_AD_READY_TO_SHOW
protected static final java.lang.String MSG_PREPARE_AD_LOADING
protected static final java.lang.String MSG_SHOW_AD_EXPIRED
protected static final java.lang.String MSG_SHOW_AD_ANOTHER_SHOWING
protected static final java.lang.String MSG_SHOW_AD_DESTROYED
protected static final java.lang.String MSG_SHOW_AD_DISMISSED
protected static final java.lang.String MSG_SHOW_AD_READY_TO_LOAD
protected static final java.lang.String MSG_SHOW_AD_LOADING
protected static final java.lang.String MSG_SHOW_AD_SHOWING
public InterstitialAd(Context context)
context
- the context that owns this InterstitialAdpublic void setListener(AdListener adListener)
setListener
in interface Ad
public boolean loadAd()
loadAd
in interface Ad
com.amazon.device.ads.Ad#loadAd(AdTargetingOptions)}
public boolean loadAd(AdTargetingOptions options)
AdListener.onAdLoaded(Ad, AdProperties)
is called.
When the ad fails to load the
AdListener.onAdFailedToLoad(Ad, AdError)
is called.
An ad that is currently loaded will only be cleared if the new Ad.loadAd(AdTargetingOptions)
call completes successfully.
Ad.loadAd(AdTargetingOptions)
call will return true if a background thread is created to load a new ad, and false if the
load ad request is ignored because there is currently a background thread in progress.
loadAd
in interface Ad
options
- Additional ad options. Use this parameter to set targeting settingspublic static boolean isAdShowing()
public boolean isLoading()
Ad.loadAd(AdTargetingOptions)
call can be made.public boolean isShowing()
public boolean isReady()
public boolean showAd()
public int getTimeout()
getTimeout
in interface Ad
public void setTimeout(int timeout)
Ad.loadAd(AdTargetingOptions)
is called.
The default value is 20000 milliseconds.setTimeout
in interface Ad
timeout
- The timeout in milliseconds.