layout | title | description | top_nav_section | nav_section | sidebarType |
---|---|---|---|---|---|
page_v2 |
AdUnit - Android |
AdUnit - Android |
prebid-mobile |
prebid-mobile |
2 |
{:.no_toc}
The AdUnit
object is an abstract object that cannot be instantiated. Use the BannerAdUnit or InterstitialAdUnit object to create and configure the desired type of ad unit within your app.
- TOC {:toc}
AdUnit
properties and methods are inherited by BannerAdUnit
and InterstitialAdUnit
.
Parameters
configId
: String containing the Prebid Server configuration ID.adType
:BANNER
orINTERSITIAL
. This value will be set by the object based on which type of ad unit object you create.
Properties
configId
: Prebid Server configuration ID.adType
:BANNER
orINTERSITIAL
.periodMillis
: Integer defining the refresh time in milliseconds. Default = 0, meaning no auto refresh.keywords
: ArrayList containing keys and values.
Trigger a call to Prebid Server to retrieve demand for this Prebid Mobile ad unit.
Parameters
adObj
: bid request objectonCompleteListener
: listener object
Set a single key-value pair.
Parameters
key
: String containing the key.value
: String containing the value.
Define multiple values for a single key.
Parameters
key
: String containing the key.values
: String array containing the list of values for the key.
Remove a key and all its associated values from a given Prebid Mobile ad unit.
Parameters
key
: String containing the key you want to remove.
Clear all key-value combinations from the Prebid Mobile ad unit.
Parameters
none
If set on a given Prebid Mobile ad unit, the fetchDemand
function will be called every periodMillis
until stopAutoRefresh
is called. Each call to fetchDemand
will invoke the onComplete
function. This refresh only pertains to Prebid Mobile and not to any ad server refresh processes. It is suggested that the adServers refresh be turned off.
Parameters
periodMillis
: Integer defining the refresh time in milliseconds.
Starts the auto-refresh behavior for a given Prebid Mobile ad unit.
Halts the auto-refresh behavior for a given Prebid Mobile ad unit. If no auto-refresh behavior has been set, stopAutoRefresh
will be ignored.
Parameters
none
InterstitialAdUnit interstitialAdUnit = new InterstitialAdUnit("PREBID_SERVER_CONFIGURATION_ID");
interstitialAdUnit.setUserKeyword("my_key", "my_value");
interstitialAdUnit.fetchDemand(publisherAdRequest, new onCompleteListener() {
@Override
public void onComplete(ResultCode resultCode) {
dfpInterstitial.loadAd(publisherAdRequest);
}
});