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
Nested ClassesModifier and TypeInterfaceDescriptionstatic @interfaceAn interface to hold default values.static @interfaceAn interface to hold key constants.static @interfaceAn interface to hold value constants. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringClass name for the dynamic widget.static final StringShared preferences key constant if GDPR applies.static final StringShared preferences key constant for purpose consents.static final StringShared preferences key constant for purpose legitimate interests.static final StringShared preferences key constant for vendor consents.static final StringShared preferences key constant for vendor legitimate interests.static final intConstant for the no layout resource.static final StringFile name for the dynamic ads preferences. -
Method Summary
Modifier and TypeMethodDescriptionintReturns the optional layout resource for this ad.Returns the listener used by this ad.com.google.android.gms.ads.AdRequestThis method will be called to build the ad request for this ad.com.google.android.gms.ads.RequestConfigurationThis method will be called to get the ad request configurations.Returns the unit id for this ad.com.google.android.ump.ConsentFormReturns the consent form if available.com.google.android.ump.ConsentInformationReturns the consent information if available.booleanChecks if any constraints should be matched before loading the ad.booleanChecks whether the ad has been loaded.booleanReturns whether this ad is visible to the user.voidTry to create the new ad.voidTry to destroy the ad instances and do cleanup.voidTry to pause the running ad.voidTry to resume the paused ad.voidonCustomiseAd(boolean loaded) This method will be called to do the ad customisations.voidThis method will be called to do the initialization.voidonPostAdLoaded(boolean loaded) This method will be called after the ad has been loaded.voidTry 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-trueif 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-trueif 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:
trueif the ad is allowed to be loaded.
-
isAdLoaded
boolean isAdLoaded()Checks whether the ad has been loaded.- Returns:
trueif 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:
trueif 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.
-