Initial Setting(Android Studio) - united-adstir/AdStir-Integration-Guide-Android GitHub Wiki

Setup Google Play services

This SDK depends on Google Play services. You have to setup support library.

  1. Open Tools menu, click Android -> SDK Manager.
  2. Update the Android Studio SDK Manager: click SDK Tools, expand Support Repository, select Google Repository, and then click OK. Setp 1-1
  3. Open the build.gradle file inside your application module directory.
  4. Add a new build rule under dependencies for the latest version of play-services. For example:
apply plugin: 'com.android.application'
    ...

    dependencies {
        implementation 'com.google.android.gms:play-services:10.0.1'
    }

Add SDK

Please add SDK to the project with reference to Write to build.gradle or Add SDK manually.

Write to build.gradle

Add the following code to your application’s build.gradle.

repositories {
    jcenter()
    maven { url 'http://cdnp.ad-stir.com/m2' }
}
dependencies {
    implementation 'com.google.android.gms:play-services-ads-lite:x.x.x'

    // You will need to change the version number to the adstir SDK version
    def adstir_version = "2.12.0"
    implementation "com.ad-stir.webviewsdk:adstir-webviewsdk:${adstir_version}"
}

Add SDK manually

Download SDK

  1. Please log in to our dashboard and open Get SDK/Code page. Step 2-1

  2. In Downlaod SDK section, choose and download AdStir SDK(Android/AAR format).

  3. Check Media ID and Ad Unit No. in SDK Parameter section. Step2-3

Add SDK

  1. Unzip downloaded file
  2. Select menu File -> New -> New Module -> Import JAR / AAR Package
  3. Select library from package.
  4. Open Project Structure (File -> Project Structure)
  5. Select app tab, and add dependency for library that imported.

ProGuard rules

If you are using ProGuard, please add following rules to proguard-rules.pro (or any other configuration file).

-keep class com.google.android.gms.ads.** {*;}
-keep class com.ad_stir.** {*;}

-keepattributes EnclosingMethod