Banner Ad Integration Guide Appnext Bundled(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.

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.

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

Add build dependencies

  1. Open the build.gradle file inside your application module directory.
  2. 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'
        implementation 'com.google.android.gms:play-services-basement:10.0.1' // <- append
        implementation 'com.google.android.gms:play-services-location:10.0.1' // <- append
    }

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.** { *; }

# Appnext
-keep class com.appnext.** { *; }
-dontwarn com.appnext.**

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.