Android Ad Formats

Banner/MREC Ads Interstitial Ads Rewarded Ads

Integrating Banner/MREC Ads

Integrating an Ad Placement allows you to integrate different ad types into your SDK.  Each option is detailed in the tabs above.

Follow the steps below to integrate Banner/MREC ads into your SDK.

Step 1: Adding the Ad Placement

Add the Ad Placement integration for the display as well as the Adview Controller:

// Spot integration for display square
InneractiveAdSpot mSpot = InneractiveAdSpotManager.get().createSpot();

// Adding the adview controller
InneractiveAdViewUnitController controller = new

Step 2: Making the Ad Request

The request and display steps are separate for the Ad Placement. It's time to set up the ad request.

InneractiveAdRequest adRequest = new
// To perform the ad request mSpot.requestAd(adRequest);

Step 2a: Listening to Request Events

The following example illustrates how a RequestListener is used:

InneractiveAdSpot.RequestListener mSpotListener = new
InneractiveAdSpot.RequestListener() { @Override // When the ad request sends successfully. public void onInneractiveSuccessfulAdRequest(InneractiveAdSpot inneractiveAdSpot) { } @Override // When the ad request fails to send. public void onInneractiveFailedAdRequest(InneractiveAdSpot inneractiveAdSpot, InneractiveErrorCode inneractiveErrorCode) {
} }; mSpot.setRequestListener(mSpotListener);

Step 3: Displaying the Ad

Once you've set up the request, it's time to set up displaying the ad.  

Step 3a: Define Your Ad Layout

Use the code in your XML layout to define your ad layout.

 android:layout_height="wrap_content" />

Step 3b: Setting-Up Displaying an Ad

After a successful Ad Request, use the code below for Setting Up Displaying the Ad.

// Check if we have ad content
if (mSpot.isReady()) {
// Getting the spot's controller InneractiveAdViewUnitController controller = (InneractiveAdViewUnitController)mSpot.getSelectedUnitController(); // Getting the ad view container ViewGroup layout = (ViewGroup)findViewById(; // Showing the ad controller.bindView(layout); }

Step 4: Listening to the Events

In addition, it shows how to add an event listener properly for receiving Banner/MREC ad callbacks.

controller.setEventsListener(new InneractiveAdViewEventsListener() {
       public void onAdImpression(InneractiveAdSpot adSpot) {
           Log.i(TAG, "onAdImpression");
       public void onAdClicked(InneractiveAdSpot adSpot) {
           Log.i(TAG, "onAdClicked");
       public void onAdWillCloseInternalBrowser(InneractiveAdSpot adSpot) {
           Log.i(TAG, "onAdWillCloseInternalBrowser");
       public void onAdWillOpenExternalApp(InneractiveAdSpot adSpot) {
            Log.i(TAG, "onAdWillOpenExternalApp");
       @Override //Since VAMP 7.2.0
       public void onAdEnteredErrorState(InneractiveAdSpot adSpot, AdDisplayError error) {
            Log.i(TAG, "onAdEnteredErrorState");


onAdEnteredErrorState Starting from Android DT Exchange SDK version 7.5.4, this callback is also invoked in cases where the WebView renderer process has crashed. In such cases, the instance of the AdDisplayError appears as WebViewRendererProcessHasGoneError. If this error was triggered for a banner/mrec, we recommend to destroy the banner/mrec and request a new one. No additional steps are required for interstitial ad units.

You have now completed the process of adding your Ad Placement!

Releasing an Ad Placement

Click here for details of how to release an Ad Placement.

Back to Top ⇧