MoPub Ad Intergration - united-adstir/AdStir-Integration-Guide-Android GitHub Wiki
Supported OS version
MoPub Ads Supported Android 4.1 or later.
Setup MoPub Mediation SDK
Before MoPub Ad integration, please contact your account manager or contact from Contact Form.
Add SDK
Please add MoPub SDK and MoPub mediation adapter in 1. or 2.
1. 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}"
implementation "com.ad-stir.mediationadapter:adstir-mediationadapter-mopub:${adstir_version}"
}
2. Add SDK manually
- Select menu File -> New -> New Module -> Import .JAR/.AAR Package
- Select
mopub-sdk.aar
andandroidwebviewmediation-adapter-mopub.aar
- Select menu File -> Project Structure -> app -> Dependencies
- Select
app
tab, and addmopub-sdk
,androidwebviewmediation-adapter-mopub
dependency.
gradle settings
repositories {
...
jcenter()
}
dependencies {
...
// implementation 'com.mopub.volley:mopub-volley:1.1.0' // adstir sdk Less than 2.11.4
// implementation 'com.mopub.volley:mopub-volley:2.0.0' // adstir sdk 2.11.4 or higher
implementation 'com.mopub.volley:mopub-volley:2.1.0' // adstir sdk 2.14.1 or higher
implementation 'com.android.support:recyclerview-v7:x.x.x'
// implementation 'com.google.android.exoplayer:exoplayer:r1.5.6' // adstir sdk Less than 2.10.3
// implementation 'com.google.android.exoplayer:exoplayer:r2.4.4' // adstir sdk 2.10.3 or higher
// implementation 'com.google.android.exoplayer:exoplayer:r2.8.2' // adstir sdk 2.13.0 or higher
// implementation 'com.google.android.exoplayer:exoplayer:2.8.3' // adstir sdk 2.13.4 or higher
implementation 'com.google.android.exoplayer:exoplayer:2.9.5' // adstir sdk 2.14.1 or higher
}
ProGuard rules
If you are using ProGuard, please add following rules to proguard-rules.pro
(or any other configuration file).
-dontwarn com.mopub.**
-keep class com.mopub.** {*;}