Android

The CrystalExpress AdMob Custom Event allows AdMob publishers to add CrystalExpress as a Custom Ad Network within the AdMob platform.

CrystalExpress provides four ad formats for AdMob mediation. The relationship between AdMob ad unit and ad format in CrystalExpress is as following:

AdMob ad unit

AD format from CrystalExpress

Banner

Card AD

Rewarded Video

Rewarded Video AD

Interstitial

Splash AD

Native Advanced

Native AD

NOTICE: The aspect ratio for CrystalExpress ad is 16:9, 4:3 or 1:1.

Before adding CrystalExpress as Custom network, you have to integrate AdMob SDK by following the instructions on the AdMob website.

NECESSARY STEPS:

  • Get CrystalExpress SDK and Crystal ID.

  • Integrate the CrystalExpress SDK.

    For SDK 3.32 and above, there is no need for moat-x.jar anymore. If there was one in libs folder, please remove it. (For previous SDK version, please still copy moat-x.jar to the libs folder of your app project.

  • Add CrystalExpress AdMob Custom Event into project.

  • Configure AdMob dash board to mediate CrystalExpress.

Get CrystalExpress SDK and Crystal ID

Please contact your Intowow account manager. We will provide the right version of SDK and Crystal ID according to your needs.

Integrate the CrystalExpress SDK.

Please refer to the Setup and Initialize SDK document in Android SDK.

Add CrystalExpress's AdMob Custom Event into project

Step 1

Contact Intowow account manager for CrystalExpress AdMob Custom Event and sample code.

Step 2

Unzip ce-[premium|lite]-global-custom-event-SDKversion.zip.

  • For Banner

    Add file CECustomEventCard.javafrom /CustomEvents/AdMob/Banner to your app's project folder

    • Size of AdView could be assigned in two ways.

      1. Set the size defined by AdMob API

        e.g. adView.setAdSize(AdSize.BANNER);

      2. Custom size

        e.g. adView.setAdSize(new AdSize(300, 169));

  • For Rewarded Video

    Add file CEMediationAdapterRewardedVideo.java from /CustomEvents/AdMob/Rewardedvideo/ to your app's project folder.

  • For Interstitial AD

    Add file CECustomEventInterstitial.java from /CustomEvents/AdMob/Interstitial/ to your app's project folder.

  • For Native Advanced (Only support AdMob SDK version 11.4.0 or above)

    Add file CECustomEventNativeAdvanced.java from /CustomEvents/AdMob/NativeAdvanced to your app's project folder.

    • Please inform AdMob SDK the height and width of media view using following method otherwise the aspect ratio of media view might be wrong:

      Bundle extras = new CECustomEventNativeAdvanced.CustomEventExtrasBundleBuilder()
                 .setMediaViewWidth(mediaView.getLayoutParams().width)
                 .setMediaViewHeight(mediaView.getLayoutParams().height)
                 .build();

      And add above bundle into AdRequest as follow:

      AdRequest nativeAdRequest = new AdRequest.Builder()
                 .addCustomEventExtrasBundle(CECustomEventNativeAdvanced.class, extras).build();

For further integration issues, please check the sample code within download folder.

Configure AdMob to mediate CrystalExpress

Step 1

Log in to your AdMob account and register your application on your account dashboard.

If you have set up a Mediation Group, please click the Mediation Group and skip Step 1. 1. Click Mediation in the side bar and Create Mediation Group.

2. Select targeted ad format(Banner / Rewarded Video) and Platform, and click CONTINUE.

3. Set up Name and Ad units to mediation group

Step 2

1.Click ADD CUSTOM EVENT in the ad sources table

Step 3

1.Please set up the name(Label) and eCPM for your Custom Event, and click CONTINUE.

2. Add Custom Event Class Name for Android: (Please set the path correspond to the class you located.)

  • Banner ad: Please enter <packageName>.<path>.CECustomEventCard

  • Interstitial ad: Please enter <packageName>.<path>.CECustomEventInterstitial

  • Rewarded Video ad: Please enter <packageName>.<path>.CEMediationAdapterRewardedVideo

  • Native Advanced ad: Please enter <packageName>.<path>.CECustomEventNativeAdvanced

3. Add Parameter for Android:

To request ad from intowow successfully, Please insert the placement id received by intowow account manager.

  • Banner ad: Please contact intowow account manager for the placement id.

  • Rewarded Video ad: Please contact intowow account manager for the placement id.

Click DONE.
Click Save

Step 4

Request ad as the instructions for Banner Integration, Interstitial Integration, Rewarded Video Integration, Native Advanced Integration from AdMob.

Proguard (Optional)

If you are using Proguard to obfuscate your code, please refer to the proguard document in Android SDK.

The Layout of CrystalExpress AD

In AdMob Custom Event, our SDK will keep the aspect ratio of creatives and try to fit the ad view that you bind to AdMob.

If the aspect ratio for the ad view to be bound and the creative are inconsistent, the return ad will be filled with black background to match the aspect ratio.

Last updated