Banner Ad
1. Basic Requirements
Add ADX Android SDK to your project.
Use the Ad Unit ID issued for Banner Ad.
Before requesting an ad, SDK initialization must be done first.
SDK initialization should be called only once when the app launches and ad requests should be made after SDK initialization is complete.
2. Setting Up the Layout
To display the BannerAd in your layout, add the ad to the corresponding Activity or Fragment.
Enter the Ad Unit ID and specify the banner ad size.
The supported sizes are listed below and must be specified.
AD_SIZE_320x50, AD_SIZE_728x90, AD_SIZE_320x100, AD_SIZE_300x250
<com.adxcorp.ads.BannerAd
android:id="@+id/banner"
android:layout_width="320dp"
android:layout_height="50dp"
app:ADX_UNIT_ID="<BANNER_AD_UNIT_ID>"
app:BANNER_AD_SIZE="AD_SIZE_320x50">
</com.adxcorp.ads.BannerAd>3. Creating an Ad Object
If you prefer to write code directly instead of using layout setup, add the BannerAd to the corresponding Activity or Fragment to display it.
Enter the Ad Unit ID and specify the banner ad size.
The supported sizes are listed below and must be specified.
4. Implementation
Instantiate the
BannerAdand add theBannerAdListener.Call
loadAd()to load the ad.When the ad is no longer needed, call
BannerAd’sdestroy()in the Activity or Fragment’sonDestroy()method to remove it.
5. Callback
You can set the BannerAd’s BannerListener to receive specific events. Implement it as needed.
6. Ad Revenue (OnPaidEvent)
You can receive the estimated ad revenue while an ad impression occurs.
Manually set values during mediation setup and actual values may be mixed, so it is recommended to treat this as an estimate.
The currency unit of eCPM is USD.
As shown in the example below, use
OnPaidEventto check the estimated eCPM value.You can link ad revenue data with your MMP. For details, please refer to the SDK integration guides below:
Last updated
Was this helpful?