Show Sidebar

Requesting Billboard Ads – Android SDK 3.6

Rất tiếc, mục này chỉ tồn tại ở English. For the sake of viewer convenience, the content is shown below in the alternative language. You may click the link to switch the active language.

For Billboard Ads, please ensure that you have turned off the refresh from the mediation partner’s web interface when using a fresh integration of VMAX SDK 3.4.0 or higher. This change in settings is not required when updating from an earlier version to 3.4.0 or higher.
Also ensure that the billboard view/container in which the billboard will appear is not visible by default. Use the onAdStarted() callback to make the billboard view/container visible and hide it using onAdDismissed() so as to avoid any conflict with Ad network billboard from mediation partners.

For your reference purpose, We have created VMAX Sample App for Billboard adspot. This app is open source and uploaded on Github where you can download and read example code for requesting Billboard Ads

Click here to download Billboard demo App

To request a billboard through XML (preferred)

Create below VmaxAdview in your main Layout file

Code to invoke Billboard Ads in your Activity class

To request a billboard programmatically

Create below Layout in main layout file

Code to invoke Billboard Ads in your Activity class

Advanced

VMAX allows you to cache a billboard ad in one Activity and show it in a different Activity.

To Cache Billboard Programmatically

Code to invoke Billboard Ads in your Activity class

To Show Billboard Programmatically

Create below Layout in main layout file

Before SDK 3.6.0

Requesting Banners with Strict Dimensions (SBD)

This will allow VMAX to fetch banners with strict dimensions with the below Ad sizes:

  • 320×50
  • 728×90
  • 300×250
  • 480×320
  • 480×800
  • 1024×600

Refer to the VmaxAdSize class for more information.

You need to pass the constant “sbd” (Refer VmaxAdSettings) with one of the above values in hashmap.

Mediation partners supported for SBD are Admob, Facebook, and Millennial Media with sizes
“320×50”, “728×90” , “300×250”

Ad size Mediation Partner Instructions
320×50 and

728×90 Banner

VMAX Agency Ads Create a Banner Adspot on the VMAX dashboard.
Admob Create an Admob adunit id on your Admob dashboard and link it to a VMAX banner Adspot.
Facebook Create a Facebook placement id on your Facebook dashboard and link it to a VMAX banner Adspot.
Millennial Media Create a Millennial Media Banner Appid (Banner placement) on your MM dashboard and link it to a VMAX banner Adspot.
300×250 Billboard VMAX Agency Ads Create a Billboard Adspot on the VMAX dashboard.
Admob Create an Admob banner adunit id on your Admob dashboard and link to a VMAX Billboard Adspot.

*Backend configuration is required (kindly contact your VMAX Account Manager)

Facebook Create a Facebook banner placement id on your Facebook dashboard and link to a VMAX Billboard Adspot.

*Backend configuration is required (kindly contact your VMAX Account Manager)

Millennial Media Create a Millennial Media rectangle Ap id (Rectangle placement) on your MM dashboard and link to a VMAX Billboard Adspot. As MM will always serve a rectangle ad (300×250), ignore the ad settings passed by VMAX, if any.
480×320, 480×800, and 1024×600 Billboard VMAX Agency Ads Create a Billboard Adspot on the VMAX dashboard.

 

Note:

  1. UX type for the aforementioned Banner Ads will be UX_INLINE_DISPLAY. “sbd” with fixed value (banner size) is mandatory for all above cases which need to be passed via the VMAX SDK. Refer to the code Snippet shown below.
  2. Mediation partners Admob, Facebook, and Millennial Media support ads of the sizes “320×50”, “728×90” , “300×250”
  3. As MM provides the provision for creating different ids for banner and rectangle ads (300×250), ignore any hardcoded size passed by MM SDK. It supports 320×50 and 728×90 for banner Ads perfectly as these are passed by the MM SDK.

To request a banner with strict dimensions through XML

Create below VmaxAdView in your layout file

Add below code in your Activity class

To request a banner with strict dimensions programmatically

Add below code in your Layout file

Add below code in your Activity file

Advanced

To Cache Banners with strict dimensions Programmatically

Code to invoke Banner Ads in your Activity class

To Show Banners with strict dimensions Programmatically

Create below Layout in main layout file

What would you like to do next?