Show Sidebar

AdMob Integration using Android SDK

ขออภัยรายการนี้จะใช้ได้เฉพาะในภาษาอังกฤษ 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.

Latest Google Play Services Ads Library Supported.

Supported Ad Formats: The VMAX SDK supports native ads (Admob Native Express Ads as Admob Native Advanced Ads are still in beta and open for limited publishers), banners, and interstitials from AdMob.

You will need

  1. an active AdMob account
  2. Ad unit ID
  3. Refresh Token

In your AdMob Account

To find the ad unit ID, click the Monetize tab. Select an app from the list of apps in the sidebar. The ad unit ID is listed below the ad unit name.

Read more on how to get your refresh token here.

Further Integration

Step 1: The AdMob adapters are a part of the VMAX base SDK but you need to add Google Mobile Ads library to Your Project as mentioned.

Step 2: Add the accompanying code inside the <application> tag in AndroidManifest.xml

Step 3: Add the following permissions to AndroidManifest.xml

Step 4: [Additional Step for Native Ads] Make sure you pass Native Ad size to Vmax SDK while requesting Admob Express Ads. Add below snippet before making Ad request(cacheAd())
a) Programatic Approach: Pass height and width on the vmaxAdView object

From SDK 3.7.5 onwards

Before Sdk 3.7.5
b) Xml Approach: Pass width and height in the attributes vmax:compositeViewWidthInDp and vmax:compositeViewHeightInDp respectively

What would you like to do next?