public class ModelessInterstitialAd extends java.lang.Object implements Ad
Making ad requests to the Amazon Mobile Ad Network requires the INTERNET permission. Additionally we recommend that you include permissions for FINE_LOCATION, COURSE_LOCATION, NETWORK_STATE, and WIFI_STATE. These additional permissions allow Amazon to provide contextual and geo-targeted ads to your users, which may result in higher CPMs. Declare these permissions in your AndroidManifest.xml.
| Constructor and Description |
|---|
ModelessInterstitialAd(android.view.ViewGroup hostedViewGroup)
Constructs a new ModelessInterstitialAd.
|
| Modifier and Type | Method and Description |
|---|---|
void |
adHidden()
Puts the ad into a background state.
|
boolean |
adShown()
Fires impression pixel and makes ad clickable if the following criteria is met:
1.
|
void |
destroy()
Destroys all the resources being used by the ModelessInterstitialAd.
|
int |
getTimeout()
Gets the current timeout value in milliseconds.
|
boolean |
isLoading()
Gets whether this Ad is currently being loaded.
|
boolean |
isReady()
Tells whether this ModelessInterstitialAd is ready to show.
|
boolean |
loadAd()
Creates a background thread to load a new ad.
|
boolean |
loadAd(AdTargetingOptions adTargetingOptions)
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.
|
public ModelessInterstitialAd(android.view.ViewGroup hostedViewGroup)
hostedViewGroup - the hosting container that will contain the adpublic void setListener(AdListener adListener)
setListener in interface AdadListener - An instance of AdListener that will be notified during ad life-cycle changes.public boolean loadAd(AdTargetingOptions adTargetingOptions)
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 AdadTargetingOptions - Additional ad options. Use this parameter to set targeting settingspublic boolean loadAd()
public boolean isLoading()
Ad.loadAd(AdTargetingOptions) call can be made.public int getTimeout()
getTimeout in interface Adpublic void setTimeout(int timeout)
Ad.loadAd(AdTargetingOptions) is called.
The default value is 20000 milliseconds.setTimeout in interface Adtimeout - The timeout in milliseconds.public boolean adShown()
adHidden() when the ad is no longer in viewpublic void adHidden()
public void destroy()
public boolean isReady()