Initial Setting(Android Studio) - united-adstir/AdStir-Integration-Guide-Android GitHub Wiki
Google Play services
Setup This SDK depends on Google Play services. You have to setup support library.
- Open
Tools
menu, clickAndroid
->SDK Manager
. - Update the Android Studio SDK Manager: click SDK Tools, expand
Support Repository
, selectGoogle Repository
, and then clickOK
. - Open the
build.gradle
file inside your application module directory. - 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
-
Please log in to our dashboard and open
Get SDK/Code
page. -
In
Downlaod SDK
section, choose and downloadAdStir SDK(Android/AAR format)
. -
Check
Media ID
andAd Unit No.
inSDK Parameter
section.
Add SDK
- Unzip downloaded file
- Select menu
File
->New
->New Module
->Import JAR / AAR Package
- Select library from package.
- Open
Project Structure
(File
->Project Structure
) - 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