Mobvista広告の導入 - united-adstir/AdStir-Integration-Guide-Android GitHub Wiki

対応OS

Mobvistaはadstir SDK 2.12.0以降をお使いの場合はAndroid 4.4以上の端末に配信されます。 adstir SDK 2.12.0未満をお使いの場合はAndroid 4.1以上の端末に配信されます。

Mobvista対応SDKの準備

バンドル版の入手は、担当またはお問い合わせフォームよりご連絡ください。

プロジェクトへSDKの追加

初期設定でbuild.gradleへ記述してSDKを追加した場合は1.で、手動でSDKを追加した場合は2.でプロジェクトへSDKを追加します。

1. build.gradleへ記述してSDKを追加した場合

アプリケーションのモジュールディレクトリにあるbuild.gradleを開き、repositoriesセクションを追加し、dependenciesセクションへ以下のように追記します。 バージョンは変更履歴よりご選択ください。

apply plugin: 'com.android.application'
    ...

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

        // 利用するadstirのSDKバージョンを設定します
        def adstir_version = "x.x.x"
        implementation "com.ad-stir.webviewsdk:adstir-webviewsdk:${adstir_version}"
        implementation "com.ad-stir.mediationadapter:adstir-mediationadapter-mobvista:${adstir_version}"
    }

2. 手動でSDKを追加した場合

  1. File -> New -> New Module -> Import .JAR/.AAR Package より以下のファイルを追加します。
    • mintegral_alphab.aar
    • mintegral_common.aar
    • mintegral_mvjscommon.aar
    • mintegral_playercommon.aar
    • mintegral_reward.aar
    • mintegral_videocommon.aar
    • mintegral_videojs.aar
    • androidwebviewmediation-adapter-mobvista.aar
  2. File -> Project Structure -> app -> Dependencies より以下を追加します。
    • mintegral_alphab
    • mintegral_common
    • mintegral_mvjscommon
    • mintegral_playercommon
    • mintegral_reward
    • mintegral_videocommon
    • mintegral_videojs
    • androidwebviewmediation-adapter-mobvista

* adstir SDK 2.13.0よりmobvista_* から mintegral_*に変更になっております。

ProGurdの設定

ProGuardを使用しているアプリにはproguard-rules.proに、下記の内容を追加してください。
この記述が無い場合、adstirの機能を正常に利用することができません。

-keepattributes Signature
-keepattributes *Annotation*
-keep class com.mintegral.** {*; }  
-keep interface com.mintegral.** {*; }  
-keep class android.support.v4.** { *; }  
-dontwarn com.mintegral.**
-keep class **.R$* { public static final int mintegral*; }
-keep class com.alphab.** {*; }
-keep interface com.alphab.** {*; }