public static classAdLoader.BuilderextendsObject
Builder for aAdLoader
.
Public Constructor Summary
Public Method Summary
AdLoader | |
AdLoader.Builder |
forAdManagerAdView(OnAdManagerAdViewLoadedListener
listener,AdSize...
adSizes)
Registers a listener to handle loading a Google Ad Manager banner ad.
|
AdLoader.Builder |
forCustomFormatAd(String
customFormatId,
NativeCustomFormatAd.OnCustomFormatAdLoadedListeneradLoadedListener,
NativeCustomFormatAd.OnCustomClickListenercustomClickListener)
Enables the
AdLoader to load custom format ads.
|
AdLoader.Builder |
forNativeAd(NativeAd.OnNativeAdLoadedListener
listener)
Registers a listener to handle loading a
NativeAd .
|
AdLoader.Builder |
withAdListener(AdListener
listener)
|
AdLoader.Builder |
withAdManagerAdViewOptions(AdManagerAdViewOptions
options)
Sets options to use for loading a Google Ad Manager ad view.
|
AdLoader.Builder |
Inherited Method Summary
Public Constructors
publicBuilder(Contextcontext, String adUnitID)
Creates a newAdLoader.Builder
for constructing anAdLoader
.
Parameters
context | The context. |
---|---|
adUnitID | The ad unit ID. |
Public Methods
publicAdLoader.Builder forAdManagerAdView(OnAdManagerAdViewLoadedListener listener,AdSize... adSizes)
Registers a listener to handle loading a Google Ad Manager banner ad.
Parameters
listener | The callback that will run when a banner ad loads. |
---|---|
adSizes | Sets the supported sizes of the banner ad. |
Throws
IllegalArgumentException | IfadSizes isnull or empty. |
---|
publicAdLoader.Builder forCustomFormatAd(String customFormatId, NativeCustomFormatAd.OnCustomFormatAdLoadedListeneradLoadedListener, NativeCustomFormatAd.OnCustomClickListenercustomClickListener)
Enables theAdLoader
to load custom format ads.
Parameters
customFormatId | Custom format ID defined in the Ad Manager UI. |
---|---|
adLoadedListener | A listener to be called when aNativeCustomFormatAd
loads. |
customClickListener | An optional listener to define custom click logic for ad clicks. When set, this overrides the ad's default click through behavior of navigating to the click URL defined in the Ad Manager UI. |
publicAdLoader.Builder forNativeAd(NativeAd.OnNativeAdLoadedListener listener)
publicAdLoader.Builder withAdListener(AdListener listener)
Parameters
listener | An object that handles errors encountered when retrieving native ads. |
---|
publicAdLoader.Builder withAdManagerAdViewOptions(AdManagerAdViewOptions options)
Sets options to use for loading a Google Ad Manager ad view.
Parameters
options | Google Ad Manager banner ad options. |
---|
publicAdLoader.Builder withNativeAdOptions(NativeAdOptions options)
Sets the native ad options to the ad loader builder.
Parameters
options | An object that specifies various native ad options. |
---|