Banner Ad Integration Guide(Android Studio) - united-adstir/AdStir-Integration-Guide-Android GitHub Wiki
Important: About SDK Update
When update the SDK, strongly recommended update all files in SDK package.
Supported OS version
Android 4.4 or later.
Partner ad netowrks
Please see the page of here
Setup
Before integration
Please see Initial-Setting to setup Google Play services
and download SDK.
Add libraries
Import all .aar, .jar files with following steps.
- 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).
# adstir
-dontwarn com.ad_stir.**
-keep class com.ad_stir.** { *; }
-keep interface com.ad_stir.** { *; }
For MoPub Ads integration
Before MoPub Ad integration, please contact your account manager or contact from Contact Form.
Add SDK to project
- Select menu
File
->New
->New Module
->Import JAR / AAR Package
- Select
mopub-sdk.aar
,androidwebviewmediation-adapter-mopub.aar
. - Open
Project Structure
(File
->Project Structure
) - Select
app
tab, and add dependency for library that imported.
gradle settings(MoPub)
Add following settings to app/build.gradle
.
repositories {
...
jcenter()
}
dependencies {
...
implementation 'com.mopub.volley:mopub-volley:1.1.0'
implementation 'com.android.support:recyclerview-v7:23.1.1'
implementation 'com.google.android.exoplayer:exoplayer:r1.5.6'
}
ProGuard rules(MoPub)
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.** {*;}
Integration
You can chose 2-way to integrate.
Integration with XML
<com.ad_stir.webview.AdstirMraidView
media="Media ID"
spot="Ad Unit No."
adsize="320,50"
refresh_interval="Ad refresh interval[integer]"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
- Please set adsize same as you registered.
Integration with coding
com.ad_stir.webview.AdstirMraidView view = new com.ad_stir.webview.AdstirMraidView(
activity,
"Media ID",
Ad Unit No.,
com.ad_stir.webview.AdstirMraidView.AdSize.Size320x50,
Ad refresh interval[integer]);
layout.addView(view);
- Please set 4th argument same as you registered.。
Class Reference
See also API Reference.