Show Sidebar

Upgrade Guide for VMAX Android SDK 3.6

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

Older VMAX Android SDK versions (prior to 3.6) will be deprecated soon. You are requested to upgrade to version 3.6 at the earliest to continue using VMAX in your apps.

VMAX Android SDK 3.6 has following changes compared to earlier versions:
What’s new?

VMAX SDK initialization

Now it’s not compulsory to use init() api of VmaxSdk i.e. VmaxSdk.init() for sdk initialization.
If you are integrating Rewarded interstitial then only it is mandatory to call VmaxSdk.initWithRewardedInterstitial(Activity activity, String accountKey) api

Below is the code snippet for the same

Register reward delegate

To Register above delegate for this ad format, It is required to call below api before caching the ad

Unregister reward delegate

To Unregister above delegate for this ad format, It is recommended to call this api in onDestroy() event of activity

VmaxAdListener

VmaxAdListener class has been completely modified

VmaxAdView Ad States

Corresponding with the listener as mentioned above, for SDK version 3.6.1 onwards you can check for the ad state which now will be set to one of the following possible values depending on the ad lifecycle:

You can query for the ad state by using the getAdState api on the adview as illustrated in the example below:

VmaxAdSettings

The newly introduced VmaxAdSettings class replaces the formerly used adSettings HashMap on VmaxAdView. You can now set the scale for billboard ad if required.

Also you can specify width and height for native Admob Express Ads for sdk version 3.6.1 onwards.

VmaxAdError

The newly introduced VMaxAdError class aims to provide detailed diagnosis for error situations in the ad lifecycle, allowing developers to gracefully handle such situations.You can query for the error code, description and title of the error.Below are the error states along with its code.

Error handling

Below VmaxAdListener callback will help to handle errors gracefully

VmaxAdPartner

The newly introduced VMaxAdPartner class aims to provide information about the ad sources. This is helpful in identifying ad sources during ad delivery as well as erroneous situations. You can query for the partner name and partner SDK version through the adPartner property on VMaxAdView. Below is the list of Vmax supported partners.

To Fetch the partenr specific information, use the snippet given below:

Image sampling

Note: This section is applicable only for Non-helper Native Ad format

It is recommended to go through this link before attempting the following.

VMAX SDK facilitates two approaches to apply sampling to Native ad image elements
1) Fetch the image element URL using getUrl() api on corresponding native image element object and apply sampling manually as shown below.

String iconURL = nativeAd.getIcon().getUrl();

2) Make use of VMAX helper class ImageLoader to achieve the sampling as shown below:

Vmax Native Media Controls

Autoplay, Mute, Play/Pause

You can now play & pause media content of the ad by using the play/pause apis. Further you can set the autoplay & mute properties as well, as illustrated below.

UX for Billboard ads

3.6.0 now has the UX type UX_BILLBOARD for requesting billboard ads. UX_INLINE_DISPLAY is now removed.

UX for In-Stream ads

3.6.0 now has the UX type UX_INSTREAM_VIDEO for requesting the in-stream ads; formerly classified as In-Content Video. UX_IN_CONTENT_VIDEO is now removed.

API Changes

The following classes and apis are now obsolete.

APIs removed

• Wallet class

• WalletElement class
• RewardedVideo class
• RewardedVideoDelegate class