SDK integration documentation provides instructions on how to integrate the Adtiming Mediation SDK in your APPs

AdTiming Publisher_SDK For Android Integration Guidelines

Integration Procedures

1.Overview

This Guideline introduces the integration of AdTiming’s SDK in Android Apps.

AdTiming Developer Platform offers diversified and competent monetization services and supports a variety Ads format including NativeAd, InterstitialAd, BannerAd, and Incentive VideoAd. The platform mediates AdTiming, Admob, Facebook, Unityads, Vungle, etc.

  • Use Android Studio 2.0 or higher
  • Target Android API level 28
  • MinSdkVersion level 16 or higher

2.Ads ID Application

This section introduces how to fetch and use identity information when integrating AdTiming Developer SDK, Including: APP_KEY, Placement ID, account and configurations of the mediation platform.

2.1 APP_KEY

APP_KEY is the sole identification of developer’s application on AdTiming platform. Developers need to create their Apps and obtain APP_KEY through AdTiming Developer Platform.

Image text

Image text

2.2 Placement_ID

Placement ID is the character to identify the ads placement on developer platform. Developers may create multiple ads placement on AdTiming developer platform according to their needs. The placement supports formats including BannerAd, InterstitialAd, NativeAd, VideoAd,and InteractiveAd.

Image text

2.3 Account and Setups of the Mediation Platform

The account and setups of the Mediation platform (Admob, Facebook, Mopub, Unityads, Vungle, etc) are created and managed uniformly by AdTiming.
AdTiming provides one-to-one hosting service to developers’ accounts, applications, and ads placements on each mediation platform. All you need to do is to create ad placements and to integrate SDKs of each ad platforms, then match the most adequate platform ads to your monetization through AdTiming algorithms framework.

3. Download SDK Latest release

Download SDK V5.1.3

4.Proguard

Must obfuscate the application code by following code, otherwise may cause error on ads operation.

■ Add the following categories to Proguard configuration:

  1. -dontwarn com.aiming.mdt.**.*
  2. -dontwarn com.adt.**.*
  3. -dontwarn com.mopub.**.*
  4. -dontoptimize
  5. -dontskipnonpubliclibraryclasses
  6. -keepattributes *Annotation*
  7. #adt
  8. -keep class com.admuing.** { *; }
  9. -keep class com.aiming.mdt.** { *; }
  10. -keep class com.adt.** { *; }
  11. -keep class com.mopub.** { *; }
  12. #R
  13. -keepclassmembers class **.R$* {
  14. public static <fields>;
  15. }

■ If integrate Admob ads, please add the following categories to Proguard configuration:

  1. -keep public class com.google.android.gms.** {
  2. public *;
  3. }
  4. -keep public class com.google.ads.** {
  5. public *;
  6. }

■ If integrate Facebook ads, please add the following categories to Proguard configuration:

  1. -keep class com.facebook.ads.** { *; }

■ If integrate Unity ads, please add the following categories to Proguard configuration:

  1. -keepattributes SourceFile,LineNumberTable
  2. -keepattributes JavascriptInterface
  3. -keep class android.webkit.JavascriptInterface {
  4. *;
  5. }
  6. -keep class com.unity3d.** {
  7. *;
  8. }

■ If integrate Vungle ads, please add the following categories to Proguard configuration:

  1. # Vungle
  2. -keep class com.vungle.warren.** { *; }
  3. -dontwarn com.vungle.warren.error.VungleError$ErrorCode
  4. # Moat SDK
  5. -keep class com.moat.** { *; }
  6. -dontwarn com.moat.**
  7. # Okio
  8. -dontwarn org.codehaus.mojo.animal_sniffer.IgnoreJRERequirement
  9. # Retrofit
  10. -dontwarn okio.**
  11. -dontwarn retrofit2.Platform$Java8
  12. # Gson
  13. -keepattributes Signature
  14. -keepattributes *Annotation*
  15. -dontwarn sun.misc.**
  16. -keep class com.google.gson.examples.android.model.** { *; }
  17. -keep class * implements com.google.gson.TypeAdapterFactory
  18. -keep class * implements com.google.gson.JsonSerializer
  19. -keep class * implements com.google.gson.JsonDeserializer
  20. # Google Android Advertising ID
  21. -keep class com.google.android.gms.internal.** { *; }
  22. -dontwarn com.google.android.gms.ads.identifier.**

■ If integrate AdColony ads, please add the following categories to Proguard configuration:

  1. -keepclassmembers class * {
  2. @android.webkit.JavascriptInterface <methods>;
  3. }
  4. -keepclassmembers class com.adcolony.sdk.ADCNative** {
  5. *;
  6. }
  7. -dontwarn android.app.Activity

■ If integrate Applovin ads, please add the following categories to Proguard configuration:

  1. -keep class com.applovin.** { *; }

■ If integrate MoPub ads, please add the following categories to Proguard configuration:

  1. # Keep public classes and methods.
  2. -keepclassmembers class com.mopub.** { public *; }
  3. -keep public class com.mopub.**
  4. -keep public class android.webkit.JavascriptInterface {}
  5. # Explicitly keep any custom event classes in any package.
  6. -keep class * extends com.mopub.mobileads.CustomEventBanner {}
  7. -keep class * extends com.mopub.mobileads.CustomEventInterstitial {}
  8. -keep class * extends com.mopub.nativeads.CustomEventNative {}
  9. -keep class * extends com.mopub.nativeads.CustomEventRewardedAd {}
  10. # Keep methods that are accessed via reflection
  11. -keepclassmembers class ** { @com.mopub.common.util.ReflectionTarget *; }
  12. # Support for Android Advertiser ID.
  13. -keep class com.google.android.gms.common.GooglePlayServicesUtil {*;}
  14. -keep class com.google.android.gms.ads.identifier.AdvertisingIdClient {*;}
  15. -keep class com.google.android.gms.ads.identifier.AdvertisingIdClient$Info {*;}
  16. # Support for Google Play Services
  17. # http://developer.android.com/google/play-services/setup.html
  18. -keep class * extends java.util.ListResourceBundle {
  19. protected Object[][] getContents();
  20. }
  21. -keep public class com.google.android.gms.common.internal.safeparcel.SafeParcelable {
  22. public static final *** NULL;
  23. }
  24. -keepnames @com.google.android.gms.common.annotation.KeepName class *
  25. -keepclassmembernames class * {
  26. @com.google.android.gms.common.annotation.KeepName *;
  27. }
  28. -keepnames class * implements android.os.Parcelable {
  29. public static final ** CREATOR;
  30. }

■ If integrate Tapjoy ads, please add the following categories to Proguard configuration:

  1. -dontwarn com.tapjoy.**
  2. -keep class com.tapjoy.** { *; }
  3. -keep class com.google.android.gms.ads.identifier.** { *; }

■ If integrate Chartboost ads, please add the following categories to Proguard configuration:

  1. -dontwarn com.chartboost.**.*
  2. -keep class com.chartboost.** { *; }

5.multiDex

If your project has a multDex operation,Add the following configuration items to your build.gradle file.

  1. android {
  2. buildTypes {
  3. release {
  4. multiDexKeepProguard file('multidex-config.pro')
  5. ...
  6. }
  7. }
  8. }

multidex-config.pro

  1. #adt
  2. -keep class com.admuing.** { *; }
  3. -keep class com.aiming.mdt.** { *; }
  4. -keep class com.adt.** { *; }
  5. -keep class com.mopub.** { *; }

6.Initialization

Before integrating AdTiming SDK, Android apps should first initialize the Adtiming SDK. Ads placements without initialization cannot fetch ads.
Adopt AdTiming sdk.INIT() by oncreate() method within the Activity:

  1. import com.aiming.mdt.sdk.AdtAds;
  2. public class DemoActivity extends Activity {
  3. @Override
  4. public void onCreate() {
  5. super.onCreate();
  6. String appKey = "Your AppKey";
  7. AdtAds.init(this, appKey);
  8. }
  9. }

Note:APP KEY can only be obtained by creating app on AdTiming developer platform. See details in section 2.1.

7.GDPR

As a publisher, you should integrate a Consent Management Platform (CMP) and request for vendor and purpose consents as outlined in IAB Europe’s Mobile In-App CMP API v1.0: Transparency & Consent Framework.

You can find a reference implementation of a web-based CMP and the corresponding native wrappers here: https://github.com/InteractiveAdvertisingBureau/GDPR-Transparency-and-Consent-Framework.

If you are embedding your own custom CMP, the collected end user consent information needs to be stored in PreferenceManager.getDefaultSharedPreferences using the following keys:

Key Value
IABConsent_CMPPresent boolean (Set to true if a CMP that follows the iAB specification is present in the application.)
IABConsent_SubjectToGDPR String “1” - (subject to GDPR),”0” - (not subject to GDPR),”-1” - Unknown (default before initialization)
IABConsent_ConsentString String (Base64-encoded consent string as defined in Consent string and vendor list format v1.1)
IABConsent_ParsedPurposeConsents String (String of “0”s and “1”s, where the character at position N indicates the consent status to purposeID N as defined in the Global Vendor List)
IABConsent_ParsedVendorConsents String (String of “0”s and “1”s, where the character at position N indicates the consent status to vendorID N as defined in the Global Vendor List)