Integrating an Ad Spot allows you to integrate the following ad types into your SDK:
- Medium rectangle
- Medium rectangle video
- Square video
- Landscape video
Step 1: Adding the Ad Spot
- First add the Ad Spot integration for the
display as well as the
Add the Spot Integration
// spot integration for display Square
mSpot = InneractiveAdSpotManager.get().createSpot();
// adding the adview controller
InneractiveAdViewUnitController controller = new InneractiveAdViewUnitController();
- If you want to receive video events (for Medium rectangle video, Square video and Landscape video), add the
video content controller code as well:
Add Video Content Controller
// in case we want to receive video events and increased capabilities we should add the video content controller
// the content controller is added to the ad view controller object
InneractiveAdViewVideoContentController videoContentController = new InneractiveAdViewVideoContentController();
Step 2: Making the Ad Request
The request and display steps are separate for the Ad Spot.
- It's time to set up the ad request.
Setting Up Your Ad Request
InneractiveAdRequest adRequest = new InneractiveAdRequest("");
// enriching with user and keywords data
// for gender values see: InneractiveUserConfig.Gender
adRequest.setUserParams( new InneractiveUserConfig()
// Add keywords. Separated by a comma
//when ready to perform the ad request
Step 2a: Listening to Request Events
Choose the type of listening event you would like:
Step 3: Displaying the Ad
- Once you've set up the request, it's time to set up displaying the ad.
Setting Up Displaying the Ad
// checking if we have ad content
// getting the spot's controller
InneractiveAdViewUnitController controller = (InneractiveAdViewUnitController)mSpot.getSelectedUnitController();
// getting the ad view container
ViewGroup layout = (ViewGroup)findViewById(R.id.inneractive_ad_layout);
// showing the ad
Step 4: Defining the Ad Layout
- After you've added the ad spot, it's time to define the ad layout.
Define Your Ad Layout
You have now completed the process of adding your Ad Spot!
Click here for details of how to dismiss an Ad Spot.
Click the links below to add another ad type.