Interface DynamicAd
- All Known Implementing Classes:
DynamicAppOpenAd
,DynamicBannerAd
,DynamicBaseAd
,DynamicInterstitialAd
,DynamicNativeAd
,DynamicRewardedAd
,DynamicRewardedInterstitialAd
public interface DynamicAd
An interface to implement a dynamic ad.
-
Nested Class Summary
Modifier and TypeInterfaceDescriptionstatic @interface
An interface to hold default values.static @interface
An interface to hold key constants.static @interface
An interface to hold value constants. -
Field Summary
Modifier and TypeFieldDescriptionstatic final String
Class name for the dynamic widget.static final String
Shared preferences key constant if GDPR applies.static final String
Shared preferences key constant for purpose consents.static final String
Shared preferences key constant for purpose legitimate interests.static final String
Shared preferences key constant for vendor consents.static final String
Shared preferences key constant for vendor legitimate interests.static final int
Constant for the no layout resource.static final String
File name for the dynamic ads preferences. -
Method Summary
Modifier and TypeMethodDescriptionint
Returns the optional layout resource for this ad.Returns the listener used by this ad.com.google.android.gms.ads.AdRequest
This method will be called to build the ad request for this ad.com.google.android.gms.ads.RequestConfiguration
This method will be called to get the ad request configurations.Returns the unit id for this ad.com.google.android.ump.ConsentForm
Returns the consent form if available.com.google.android.ump.ConsentInformation
Returns the consent information if available.boolean
Checks if any constraints should be matched before loading the ad.boolean
Checks whether the ad has been loaded.boolean
Returns whether this ad is visible to the user.void
Try to create the new ad.void
Try to destroy the ad instances and do cleanup.void
Try to pause the running ad.void
Try to resume the paused ad.void
onCustomiseAd
(boolean loaded) This method will be called to do the ad customisations.void
This method will be called to do the initialization.void
onPostAdLoaded
(boolean loaded) This method will be called after the ad has been loaded.void
Try to populate the new ad.
-
Field Details
-
LAYOUT_RES_NONE
static final int LAYOUT_RES_NONEConstant for the no layout resource.- See Also:
-
CLASS_DYNAMIC_WIDGET
Class name for the dynamic widget.- See Also:
-
PREFS
File name for the dynamic ads preferences.- See Also:
-
IABTCF_gdprApplies
Shared preferences key constant if GDPR applies.- See Also:
-
IABTCF_PurposeConsents
Shared preferences key constant for purpose consents.- See Also:
-
IABTCF_PurposeLegitimateInterests
Shared preferences key constant for purpose legitimate interests.- See Also:
-
IABTCF_VendorConsents
Shared preferences key constant for vendor consents.- See Also:
-
IABTCF_VendorLegitimateInterests
Shared preferences key constant for vendor legitimate interests.- See Also:
-
-
Method Details
-
getAdUnitId
Returns the unit id for this ad.- Returns:
- The unit id for this ad.
-
getAdLayoutRes
Returns the optional layout resource for this ad.- Returns:
- The optional layout resource for this ad.
-
getAdListener
Returns the listener used by this ad.- Returns:
- The listener used by this ad.
-
onInitialize
void onInitialize()This method will be called to do the initialization. -
getConsentInformation
Returns the consent information if available.- Returns:
- The consent information if available.
-
getConsentForm
Returns the consent form if available.- Returns:
- The consent form if available.
-
getAdRequest
This method will be called to build the ad request for this ad.- Returns:
- The ad request for this ad.
-
getAdRequestConfigurations
This method will be called to get the ad request configurations.- Returns:
- The ad request configurations.
-
onAdCreate
void onAdCreate()Try to create the new ad. -
onCustomiseAd
void onCustomiseAd(boolean loaded) This method will be called to do the ad customisations.- Parameters:
loaded
-true
if the ad was already loaded and using the previous instance.
-
onPostAdLoaded
void onPostAdLoaded(boolean loaded) This method will be called after the ad has been loaded.- Parameters:
loaded
-true
if the ad was already loaded and using the previous instance.
-
isAdAllowed
boolean isAdAllowed()Checks if any constraints should be matched before loading the ad.- Returns:
true
if the ad is allowed to be loaded.
-
isAdLoaded
boolean isAdLoaded()Checks whether the ad has been loaded.- Returns:
true
if the ad has been loaded.
-
populateAd
void populateAd()Try to populate the new ad. -
isAdVisible
boolean isAdVisible()Returns whether this ad is visible to the user.- Returns:
true
if this ad is visible to the user.
-
onAdResume
void onAdResume()Try to resume the paused ad. -
onAdPause
void onAdPause()Try to pause the running ad. -
onAdDestroy
void onAdDestroy()Try to destroy the ad instances and do cleanup.
-