VMAX
 
 
 
 
Show Sidebar

Requesting Banner Ads – Android SDK

Maaf, entri ini hanya boleh didapati dalam bahasa 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 Banner 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 banner view/container in which the banner will appear is not visible by default. Use the willPresentAd() callback to make the banner view/container visible and hide it using willDismissAd() so as to avoid any conflict with Ad network banners from mediation partners.

To request a banner through XML (preferred)

Create below VmaxAdview in your main Layout file

Code to invoke Banner Ads in your Activity class

To request a banner programmatically

Create below Layout in main layout file

Code to invoke Banner Ads in your Activity class

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

Read more on Advanced Targeting here.

Advanced

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

To Cache Banners Programmatically

Code to invoke Banner Ads in your Activity class

To Show Banners Programmatically

Create below Layout in main layout file

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?