Skip to content

Project Setup

d.eshenko edited this page Jan 12, 2023 · 55 revisions

⚡ Prerequisites:

  • Android Studio 3.2 or higher
  • minSdkVersion 19 or higher
  • compileSdkVersion 31 or higher
  • Gradle 4.2 or higher
  1. Add Maven repositories
  2. Add Ads Solution
  3. Method Count Reduction

Add Maven repositories

Add the following repositories block to the root-level build.gradle file so that Gradle can download the artifacts of ad networks:

allprojects {
  repositories {
     google()
     mavenCentral()
     maven { url = "https://android-sdk.is.com/" } // IronSource
     maven { url = "https://aa-sdk.s3-eu-west-1.amazonaws.com/android_repo" } // SuperAwesome
     maven { url = "https://dl-maven-android.mintegral.com/repository/mbridge_android_sdk_oversea" } // Mintegral
     maven { url = "https://artifact.bytedance.com/repository/pangle" } // Pangle
     maven { url = "https://sdk.tapjoy.com/" } // TapJoy
  }
}

Add Ads Solution

Clever Ads Solutions provide ready-made solutions for you to choose from.
Such solutions do not require you to add each network adapter separately in dependencies.
Add one of the following dependencies of the standard Clever Ads Solution to your app-level build.gradle file.

  • An Optimal Ads Solutions contains a number of stable partner networks that are recommended for use in most applications.
implementation 'com.cleveradssolutions:cas:2.9.9'
  • A Families Ads Solutions designed for applications tagged at a children's audience.
    The solution is fully compatible with apps in the Google Families Ads Program, read more below.
implementation 'com.cleveradssolutions:cas-families:2.9.9' 
  • A Base SDK of CleverAdsSolutions only without dependencies on third party adapters. Using only the base SDK, you can add any adapters separately.
implementation 'com.cleveradssolutions:cas-sdk:2.9.9' 

In the following table, you can see all the ad networks supported by Clever Ads Solutions. And a list of partners that are included in the Optimal and Families Ads solutions.

⭐ To receive release updates Subscribe

⭐ Those ad networks that are not included in standard solutions can be added separately, read more about Advanced integration.

⚠️ Please note that some ad networks require you to do Additional integration steps: Google AdMob, Meta AudienceNetwork, Yandex Mobile Ads.

Network Banner Interstitial Rewarded Optimal Families Notes
CAS Base ☑️ ☑️ ☑️ ☑️ ☑️ Notes
Google Ads ☑️ ☑️ ☑️ ☑️ ☑️ Notes
Unity Ads ☑️ ☑️ ☑️ ☑️ ☑️ Notes
IronSource ☑️ ☑️ ☑️ ☑️ Notes
AdColony ☑️ ☑️ ☑️ ☑️ ☑️ Notes
Kidoz ☑️ ☑️ ☑️ ☑️ Notes
SuperAwesome ☑️ ☑️ ☑️ ☑️ Notes
Vungle ☑️ ☑️ ☑️ ☑️ ☑️ Notes
AppLovin ☑️ ☑️ ☑️ ☑️ ☑️ Notes
InMobi ☑️ ☑️ ☑️ ☑️ ☑️ Notes
Meta AN ☑️ ☑️ ☑️ ☑️ Notes
MyTarget ☑️ ☑️ ☑️ ☑️ Notes
Mintegral ☑️ ☑️ ☑️ ☑️ Notes
Pangle ☑️ ☑️ ☑️ ☑️
Tapjoy ☑️ ☑️ ☑️ Notes
Yandex Ads ☑️ ☑️ ☑️ Notes
Chartboost ☑️ ☑️ ☑️ Notes
DigitalTurbine ☑️ ☑️ ☑️ Notes

Method Count Reduction

Adding CAS SDK to your project includes many third party mediation libraries and may cause the 64K limit on methods that can be packaged in an Android DEX file to be breached.
Consider the following suggestions to reduce the total number of methods added to your project:

Enable ProGuard

You can enable ProGuard to shrink your project code. It will discard any unused classes at the time of compilation to make the total method count as small as possible. Enable it by setting minifyEnabled true in build.gradle for the appropriate buildTypes, and by providing the rules to keep the classes required by your project.
Note the CAS SDK and adapters come bundled with the required ProGuard rules in the AARs. Therefore, you do not need to add any additional ProGuard rules to your project.

Enable MultiDEX

If you are still above a 65K method count, enabling MultiDEX may be the only solution provided by Google. You must only configure your project to MultiDex one time, but it will have an impact on build and app startup time.

Enable the MultiDEX support library to enable building your app correctly.

  1. Open your application build.gradle script.
  2. Modify the defaultConfig to mark your application as multidex enabled:
defaultConfig {
   ...
   multiDexEnabled true
}
  1. Add the following line to the dependencies element.
dependencies {
    implementation 'androidx.multidex:multidex:2.0.1'
    ...
}

🔗 Done! What’s Next?

Clone this wiki locally