public static interface NativeAdBase.NativeAdLoadConfigBuilder extends Ad.LoadConfigBuilder
| Modifier and Type | Field and Description |
|---|---|
static int |
UNKNOWN_IMAGE_SIZE
Constant for
withPreloadedIconView(int, int) that means that
preloaded bitmap will have default size. |
| Modifier and Type | Method and Description |
|---|---|
NativeAdBase.NativeLoadAdConfig |
build()
Builds a
NativeAdBase.NativeLoadAdConfig that can be used to load an ad. |
NativeAdBase.NativeAdLoadConfigBuilder |
withAdListener(NativeAdListener adListener)
Sets an InterstitialAdListener to be notified on events in control lifecycle.
|
NativeAdBase.NativeAdLoadConfigBuilder |
withBid(java.lang.String bidPayload)
Allow to loads an ad from the payload supplied with a bid.
|
NativeAdBase.NativeAdLoadConfigBuilder |
withMediaCacheFlag(NativeAdBase.MediaCacheFlag mediaCacheFlag)
This method allows to disable pre-caching for the ads while
NativeAdBase.loadAd()
pre-cache ad assets by default. |
NativeAdBase.NativeAdLoadConfigBuilder |
withPreloadedIconView(int width,
int height)
Allow to pre-load an native ad icon image into memory that allows instantly populate the
image into
MediaView or android.widget.ImageView during ad loading (if cache
is enabled) or during NativeAdBase.downloadMedia() call (if cache is disabled). |
static final int UNKNOWN_IMAGE_SIZE
withPreloadedIconView(int, int) that means that
preloaded bitmap will have default size. Note. For optimal performance you should avoid using
this value and pass exact size of MediaView or android.widget.ImageView.NativeAdBase.NativeAdLoadConfigBuilder withAdListener(NativeAdListener adListener)
adListener - the listenerNativeAdBase.NativeAdLoadConfigBuilder withBid(java.lang.String bidPayload)
withBid in interface Ad.LoadConfigBuilderbidPayload - The payload supplied with the bidNativeAdBase.NativeAdLoadConfigBuilderNativeAdBase.NativeAdLoadConfigBuilder withMediaCacheFlag(NativeAdBase.MediaCacheFlag mediaCacheFlag)
NativeAdBase.loadAd()
pre-cache ad assets by default.
However, please be aware that once you disable pre-caching, there is a risk that ad assets might not be loaded in time when an ads is shown at some cases like unstable internet connection, etc. As an impression will not be logged until ad media contents are properly shown, failure to load ad assets in time might result in lagging an impression even if adView is visible (and possibly not getting an impression at worst case).
In order to check if an impression is logged or not, please look at AdListener.onLoggingImpression(Ad)
mediaCacheFlag - pre-cache option for ad assets.NativeAdBase.NativeAdLoadConfigBuilderNativeAdBase.NativeAdLoadConfigBuilder withPreloadedIconView(int width, int height)
MediaView or android.widget.ImageView during ad loading (if cache
is enabled) or during NativeAdBase.downloadMedia() call (if cache is disabled).width - width of the icon view or UNKNOWN_IMAGE_SIZEheight - height of the icon view or UNKNOWN_IMAGE_SIZENativeAdBase.NativeAdLoadConfigBuilderNativeAdLoadConfigBuilder#withMediaCacheFlag(MediaCacheFlag),
NativeAdBase.downloadMedia()NativeAdBase.NativeLoadAdConfig build()
NativeAdBase.NativeLoadAdConfig that can be used to load an ad.build in interface Ad.LoadConfigBuilder