Android SDK Integration V5.5

Follow
Before You Start

We support Android Operating Systems Version 4.1 (API Level 16) and up. Be sure to:

  • Use Android Studio 2.0 and up

  • Target Android API level 28

  • MinSdkVersion level 16 and up

Important! We HAVE UPDATED AdTiming SDK to 5.5.x and above with which the adapters for ad networks are modularized as independent .aar files and should be downloaded as required by yourself. If you want to use AdTiming SDK to mediate networks, Be sure to follow our Add Mediation Networks and Mediation Integration Guides.

1. Overview

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

AdTiming offers diversified and competent monetization services and supports a variety of Ad formats including Native Ad, Interstitial Ad, Banner Ad, and Incentive Video Ad. The AdTiming platform mediates AdTiming, AdMob, Facebook, UnityAds, Vungle, Tapjoy, AppLovin, AdColony, Chartboost and MoPub.

 

2. Ads ID Application 

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

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 the AdTiming Developer Platform.

  • Navigate to APPS -> Select 'Apps' -> Click on 'APP KEY'mceclip0.png
  • Click on 'Copy'                     mceclip3.png

Placement ID

Placement ID identifies the ads placement at Adtiming. Developers may create multiple ads placement on the AdTiming developer platform to meet their needs. The placement supports formats including BannerAd, InterstitialAd, NativeAd, VideoAd, and InteractiveAd.

mceclip4.png

 

3. Add AdTiming SDK to your Project

AdTiming Supports both Gradle dependenceies and menual download mechanisms to integrate our SDK.

Gradle dependencies

  • Add the following to your project-level build.gradle file inside repositories section.
...
allprojects { 
repositories {
  ...        
jcenter()
 maven {
              url 
          }
  }
}
  • Add the following to your application-level build.gradle file inside dependencies section.
dependencies {
    implementation  ''
}

Manual Download

1.  Download Android SDK Version 5.5.10

2. Add the SDK to Your Project

Unzip and add the AdTimingSDK-x.x.x.aar to the libs folder in your Android Project.

WechatIMG43.png

Make sure you add the following to your Gradle build file under the dependencies section:

implementation (name:'AdTimingSDK-x.x.x', ext:'aar')

 

4. Update AndroidManifest.xml

Configure your AndroidManifest.xml to add the following permissions into the manifest tag but outside the <application> tag.

<!-- Required permissions -->
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />

 

5. Proguard 

You must add the following to your Proguard configuration file (Android Studio: proguard-rules.pro or Eclipse: proguard-project.txt) if you are using Porguard in your application. Failing to do so means errors.

 -dontwarn com.aiming.mdt.**.*
-dontwarn com.mopub.**.*

-dontoptimize
-dontskipnonpubliclibraryclasses
#adt
-keep class com.aiming.mdt.**{ *; }
-keep class com.mopub.**{ *; }

#R
-keepclassmembers class **.R$* {
public static <fields>;
}
-keepattributes *Annotation *,InnerClasses
-keepnames class * implements android.os.Parcelable {
public static final ** CREATOR;
}

6. MultiDex

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

android {
buildTypes {
release {
multiDexKeepProguard file('multidex-config.pro')
...
}
}
}

 multidex-config.pro 

#adt
-keep class com.aiming.mdt.**{ *; }

 

7. Initialization

Before you can fetch ads from AdTiming Mediation Platform, you should first initialize the Adtiming SDK when your app started. To do so, we suggest to call AdTiming SDK's init() within onCreate() of an Activity as belows:

import com.aiming.mdt.sdk.AdtAds;
public class DemoActivity extends Activity {

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
String appKey = "Your AppKey";
AdtAds.init(this, appKey, new Callback() {

// Invoked when the initialization is successful.
@Override

public void onSuccess() {
//
}

// Invoked when the initialization is failed.
@Override

public void onError(String message) {
//
}
});
}
}

Note:

  • APP KEY can only be obtained by creating apps on AdTiming.
  • We suggest that the first call to method loadAd after the app starts should be in the onSuccess callback.
  • The error message parameter in onError callback describes the cause of failure. Check the Initialization error callback called for more information and guidance on errors. 

 

8. 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.

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)

 

9. COPPA

To protect children, AdTiming does not advertise for users under the age of 13, be sure to follow the following guidelines:
  1. In order to add new application at AdTiming publisher platform and successfully create ad placement, you have to agree to the COPPA compatibility option. Please make sure your app is not designated as a child-directed mobile application. And if it is, please do not check the compatibility option.

         mceclip0.png

  1. If your app is not a child-directed application but the users may include people under the age of 13, then you must have a mechanism in the app to determine whether the current user is over 13 years old. If the user is under the age of 13, please be aware that you should not initialize AdTiming SDK in the application for load&show ads. If your application initializes AdTiming SDK for load&show ads, we default that the current user for the app is 13 years old or above.
  2. If you add a child-directed application at AdTiming publisher platform by using deceptive means or without proactively having a mechanism to determine whether the current user is under the age of 13, or if you have an actual knowledge that the current user is under the age of 13 but you still initialize the AdTiming SDK for load&show ads, AdTiming will not be held legally responsible and AdTiming reserve the right to pursue your legal liability
 

Interested in Mediation? Integrate our Rewarded Video, Interstitial Ads in your app and Follow our Add Mediation Networks and Mediation Integration Guides to mediation networks. With the Android SDK Version 5.5.0 and above, you need to download and add NOT ONLY the SDK of mediation networks  you choose to work with BUT ALSO the adapters for those networks.

6 out of 7 found this helpful

Comments

0 comments

Article is closed for comments.