Classes, members and errors of the MDN11 Android SDK.
A11
The SDK entry point: initialization, ad unit access, test mode, logging and debug tools.
Method / property
Description
init(application, appKey, hostUrls)
Initialize the SDK. Call once in Application.onCreate(). hostUrls is a list of host URLs used by the SDK to retrieve configuration.
init(application, appKey, staticConfig)
Initialize with a publisher-provided JSON config string, skipping the remote fetch. Use when no backend endpoint is available or for offline environments.
init(application, appKey, staticConfig, hostUrls)
Hybrid initialization: the SDK becomes usable immediately from staticConfig, while a remote config is fetched from hostUrls in the background and applied when it arrives.
getBannerAd(adUnitId): BannerAd
Returns a cached banner ad instance.
getInterstitialAd(adUnitId): InterstitialAd
Returns a cached interstitial ad instance.
getRewardedAd(adUnitId): RewardedAd
Returns a cached rewarded ad instance.
getMrecAd(adUnitId): MrecAd
Returns a cached MREC ad instance.
setTestAds(enabled)
Enable SDK test mode with test credentials. Must set before init().
addLogger(logger: Logger)
Register a logger to receive SDK log messages.
removeLogger(logger: Logger)
Unregister a previously added logger.
launchDebugMenu(activity)
Launch the debug tools UI. Requires the a11-sdk-debug module.
GDPR / LGPD consent per vendor. Can be updated during session.
setDoNotSell(Boolean)
US privacy (e.g CCPA) signal. Can be updated during session.
setChildDirected(Boolean)
Child directed flag (e.g. COPPA regulation). Must set before init(), cannot change after.
For a full list of which networks require direct publisher action on privacy, see the Network privacy reference.
PublisherProvidedSignals
Accessed through A11.publisherProvidedSignals.
Method
Description
setPaidUser(Boolean?)
Whether the user has made a purchase.
setUserId(String?)
Publisher-defined user ID.
setInstalledApps(List<String>?)
Package names of other publisher apps on the device.
Ad formats
BannerAd
Returned by A11.getBannerAd(adUnitId).
Member
Description
adView: View
Stable view to add to your layout. Add before calling load().
adSize: BannerAdSize
Size specification. Set before load(). Default: Standard.
listener: BannerAdListener?
Callback interface.
bestLoadedAdListener: BestLoadedAdListener?
Notified when the best cached ad for this ad unit changes. See Best loaded ad.
bestLoadedAd: AdInfo?
Snapshot of the best cached ad, or null if none.
customParameters: Map<String, Any>?
Optional network-specific key-value pairs forwarded to supporting adapters. Set before load().
load(activity)
Start loading.
show(activity)
Start rendering and impression tracking.
notifyLossToExternal(price: Double? = null)
Report that an impression for this ad unit went to an ad source outside the SDK. See External loss reporting.
InterstitialAd
Returned by A11.getInterstitialAd(adUnitId).
Member
Description
listener: InterstitialAdListener?
Callback interface.
bestLoadedAdListener: BestLoadedAdListener?
Notified when the best cached ad for this ad unit changes. See Best loaded ad.
bestLoadedAd: AdInfo?
Snapshot of the best cached ad, or null if none.
customParameters: Map<String, Any>?
Optional network-specific key-value pairs forwarded to supporting adapters. Set before load().
load(activity)
Load an ad.
show(activity)
Present the interstitial.
notifyLossToExternal(price: Double? = null)
Report that an impression for this ad unit went to an ad source outside the SDK. See External loss reporting.
RewardedAd
Returned by A11.getRewardedAd(adUnitId).
Member
Description
listener: RewardedAdListener?
Callback interface.
bestLoadedAdListener: BestLoadedAdListener?
Notified when the best cached ad for this ad unit changes. See Best loaded ad.
bestLoadedAd: AdInfo?
Snapshot of the best cached ad, or null if none.
customParameters: Map<String, Any>?
Optional network-specific key-value pairs forwarded to supporting adapters. Set before load().
load(activity)
Load an ad.
show(activity)
Present the rewarded ad.
notifyLossToExternal(price: Double? = null)
Report that an impression for this ad unit went to an ad source outside the SDK. See External loss reporting.
MrecAd
Returned by A11.getMrecAd(adUnitId).
Member
Description
view: View
Stable view to add to your layout. Add before calling load().
listener: MrecAdListener?
Callback interface.
bestLoadedAdListener: BestLoadedAdListener?
Notified when the best cached ad for this ad unit changes. See Best loaded ad.
bestLoadedAd: AdInfo?
Snapshot of the best cached ad, or null if none.
customParameters: Map<String, Any>?
Optional network-specific key-value pairs forwarded to supporting adapters. Set before load().
load(activity)
Start loading.
show(activity)
Start rendering and impression tracking.
notifyLossToExternal(price: Double? = null)
Report that an impression for this ad unit went to an ad source outside the SDK. See External loss reporting.
Ad data
AdInfo
Passed to every listener callback. Contains impression-level data when available.
Field
Type
Description
adUnitId
String
MDN11 ad unit.
adCallId
String
Unique ID for this ad call.
sdkAdapter
String
Name of the SDK adapter that served the ad.
sdkPlacementId
String?
sdkAdapter's own placement id (e.g. an AdMob ad unit id, an AppLovin zone id) - null when the adapter exposes none.
adNetworkName
String?
Ad network that served the ad.
adImpressionValue
AdImpressionValue?
Impression valuation data, if available.
extraParameters
Map<String, Any>?
Adapter-specific load-response data, keyed by network (e.g. "google_admob" / "google_ad_manager" with fields from AdMob/GAM's ResponseInfo, including the mediation group id, or "unity_ads" with fields from LevelPlay's LevelPlayAdInfo) - null when the adapter provides none.