RewardVideo BuildPackage_Android_DFP_Eng - mkaji-geniee/Geniee-SDK-Unity-Plugin GitHub Wiki
Please follow the build procedure below.
- gradle addition with Library
- Introducing libraries in Maven
- Add library manually
- Edit AndroidManifest.xml
- Connect the life cycle of Unity Activity to GNSAdSDK
- Added various ad networks
- Build procedure
- When using your own Activity
-
Open
File>Build Settings ...on the menu bar and set the following.- Platform:
Android - Build System:
Gradle
- Platform:
-
Make sure that the following library is created under Assets> Plugins> Android file to be used.
- AndroidManifest.xml
- GNSExtendsDfpUnityPlayerActivity.jar
- mainTemplate.gradle
-
Make sure that the Android Support file to be used is generated under Assets> Plugins> Android.
- android.arch.core.common-1.1.0.jar
- android.arch.core.runtime-1.1.0.aar
- android.arch.lifecycle.common-1.1.0.jar
- android.arch.lifecycle.livedata-core-1.1.0.aar
- android.arch.lifecycle.runtime-1.1.0.aar
- android.arch.lifecycle.viewmodel-1.1.0.aar
- com.android.support.animated-vector-drawable-27.1.1.aar
- com.android.support.appcompat-v7-27.1.1.aar
- com.android.support.cardview-v7-27.1.1.aar
- com.android.support.constraint.constraint-layout-1.1.2.aar
- com.android.support.constraint.constraint-layout-solver-1.1.2.jar
- com.android.support.customtabs-27.1.1.aar
- com.android.support.percent-27.1.1.aar
- com.android.support.recyclerview-v7-27.1.1.aar
- com.android.support.support-annotations-27.1.1.jar
- com.android.support.support-compat-27.1.1.aar
- com.android.support.support-core-ui-27.1.1.aar
- com.android.support.support-core-utils-27.1.1.aar
- com.android.support.support-fragment-27.1.1.aar
- com.android.support.support-media-compat-27.1.1.aar
- com.android.support.support-v4-27.1.1.aar
- com.android.support.support-vector-drawable-27.1.1.aar
- com.google.android.gms.play-services-ads-15.0.1.aar
- com.google.android.gms.play-services-ads-base-15.0.1.aar
- com.google.android.gms.play-services-ads-identifier-15.0.1.aar
- com.google.android.gms.play-services-ads-lite-15.0.1.aar
- com.google.android.gms.play-services-base-15.0.1.aar
- com.google.android.gms.play-services-basement-15.0.1.aar
- com.google.android.gms.play-services-gass-15.0.1.aar
- com.google.android.gms.play-services-gcm-15.0.1.aar
- com.google.android.gms.play-services-iid-15.0.1.aar
- com.google.android.gms.play-services-location-15.0.1.aar
- com.google.android.gms.play-services-places-placereport-15.0.1.aar
- com.google.android.gms.play-services-stats-15.0.1.aar
- com.google.android.gms.play-services-tasks-15.0.1.aar
-
Open
PlayServicesResolver>Editor>GNDependenciesand get the GNAdSDK by writing:<!-- GNAdSDK --> <androidPackage spec="jp.co.geniee.gnadsdk:GNAdSDK:4.0.0"> <androidSdkPackageIds> <androidSdkPackageId>extra-geniee-repository</androidSdkPackageId> </androidSdkPackageIds> <repositories> <repository>https://raw.github.com/geniee-ssp/Geniee-Android-SDK/master/repository</repository> </repositories> </androidPackage>Please make sure that the Geniee SDK file to be used has the following library created under
Assets>Plugins>Android.- jp.co.geniee.gnadsdk.GNAdSDK-4.0.0.aar
-
Open
PlayServicesResolver>Editor>GNDependenciesand get the GNAdDFPRewardMediationAdapter by writing:<!-- GNAdDFPRewardMediationAdapter --> <androidPackage spec="jp.co.geniee.gnaddfprewardmediationadapter:GNAdDFPRewardMediationAdapter:4.0.0.0"> <androidSdkPackageIds> <androidSdkPackageId>extra-geniee-repository</androidSdkPackageId> </androidSdkPackageIds> <repositories> <repository>https://raw.github.com/geniee-ssp/Geniee-Android-SDK/master/repository</repository> </repositories> </androidPackage>Please make sure that the Geniee SDK file to be used has the following library created under
Assets>Plugins>Android.- jp.co.geniee.gnaddfprewardmediationadapter. GNAdDFPRewardMediationAdapter-4.0.0.0.aar
-
Open
PlayServicesResolver>Editor>GNDependenciesand installGNSRewardAdapterby adding the following. Depending on the ad network to be acquired, change the description.When introducing all ad networks at once
<!-- GNSRewardAdapter All ADNW--> <androidPackage spec="jp.co.geniee.gnsrewardadapter:GNSRewardAdapter:3.0.0"> <androidSdkPackageIds> <androidSdkPackageId>extra-geniee-repository</androidSdkPackageId> </androidSdkPackageIds> <repositories> <repository>https://raw.github.com/geniee-ssp/Geniee-Android-SDK/master/repository</repository> <repository>https://jitpack.io/</repository> <repository>http://fan-adn.github.io/nendSDK-Android-lib/library/</repository> <repository>https://imobile-maio.github.io/maven/<3.0.0/repository> <repository>https://adcolony.bintray.com/AdColony/</repository> </repositories> </androidPackage>Please make sure that the Geniee SDK file to be used has the following library created under
Assets>Plugins>Android.- jp.co.geniee.gnsrewardadapter.GNSRewardAdapter-3.0.0.aar
- jp.co.geniee.gnsrewardadapter.GNSRewardAdapter-AdColony-3.0.0.aar
- jp.co.geniee.gnsrewardadapter.GNSRewardAdapter-Amoad-3.0.0.aar
- jp.co.geniee.gnsrewardadapter.GNSRewardAdapter-AppLovin-3.0.0.aar
- jp.co.geniee.gnsrewardadapter.GNSRewardAdapter-CAReward-3.0.0.aar
- jp.co.geniee.gnsrewardadapter.GNSRewardAdapter-Maio-3.0.0.aar
- jp.co.geniee.gnsrewardadapter.GNSRewardAdapter-Nend-3.0.0.aar
- jp.co.geniee.gnsrewardadapter.GNSRewardAdapter-Tapjoy-3.0.0.aar
- jp.co.geniee.gnsrewardadapter.GNSRewardAdapter-UnityAds-3.0.0.aar
- jp.co.geniee.gnsrewardadapter.GNSRewardAdapter-Vungle-3.0.0.aar
Please confirm that the following network is created under
Assets>Plugins>Androidfor the ad network SDK file to be used.- com.adcolony.sdk-3.3.5.aar
- com.applovin.applovin-sdk-8.1.0.jar
- com.evernote.android-job-1.2.0.aar
- com.github.vungle.vungle-android-sdk-6.2.5.aar
- com.google.code.gson.gson-2.7.jar
- com.maio.android-sdk-1.1.6.aar
- com.squareup.okhttp3.logging-interceptor-3.7.0.jar
- com.squareup.okhttp3.okhttp-3.7.0.jar
- com.squareup.okio.okio-1.12.0.jar
- com.squareup.retrofit2.converter-gson-2.2.0.jar
- com.squareup.retrofit2.retrofit-2.2.0.jar
- com.tapjoy.tapjoy-android-sdk-11.12.2.aar
- com.tonyodev.fetch.fetch-1.1.5.aar
- com.unity3d.ads.unity-ads-2.3.0.aar
- net.nend.android.nend-sdk-5.0.2.aar
- net.vrallev.android.cat-1.0.5.aar
Please add the library of the ad network to be used from
RewardVideo-Adnws-Android-SDKtoAssets>Plugins>Android.- AMoAd-playable-1.0.0.jar
- MediaSDK_ver_2_4_0.jar
※ For details on
RewardVideo-Adnws-Android-SDK, please contact your sales representative.Implementation of Maio
<!-- GNSRewardAdapter Maio --> <androidPackage spec="jp.co.geniee.gnsrewardadapter:GNSRewardAdapter-Maio:3.0.0"> <androidSdkPackageIds> <androidSdkPackageId>extra-geniee-repository</androidSdkPackageId> </androidSdkPackageIds> <repositories> <repository>https://raw.github.com/geniee-ssp/Geniee-Android-SDK/master/repository</repository> <repository>https://imobile-maio.github.io/maven/</repository> </repositories> </androidPackage>Please make sure that the Geniee SDK file to be used has the following library created under
Assets>Plugins>Android.- jp.co.geniee.gnsrewardadapter.GNSRewardAdapter-Maio-3.0.0.aar
Please confirm that the following network is created under
Assets>Plugins>Androidfor the ad network SDK file to be used.- com.maio.android-sdk-1.1.1.aar
Implementation of AppLovin
<!-- GNSRewardAdapter AppLovin --> <androidPackage spec="jp.co.geniee.gnsrewardadapter:GNSRewardAdapter-AppLovin:3.0.0"> <androidSdkPackageIds> <androidSdkPackageId>extra-geniee-repository</androidSdkPackageId> </androidSdkPackageIds> <repositories> <repository>https://raw.github.com/geniee-ssp/Geniee-Android-SDK/master/repository</repository> </repositories> </androidPackage>Please make sure that the Geniee SDK file to be used has the following library created under
Assets>Plugins>Android.- jp.co.geniee.gnsrewardadapter.GNSRewardAdapter-AppLovin-3.0.0.aar
Please confirm that the following network is created under
Assets>Plugins>Androidfor the ad network SDK file to be used.- com.applovin.applovin-sdk-8.0.1.jar
Implementation of UnityAds
<!-- GNSRewardAdapter UnityAds --> <androidPackage spec="jp.co.geniee.gnsrewardadapter:GNSRewardAdapter-UnityAds:3.0.0"> <androidSdkPackageIds> <androidSdkPackageId>extra-geniee-repository</androidSdkPackageId> </androidSdkPackageIds> <repositories> <repository>https://raw.github.com/geniee-ssp/Geniee-Android-SDK/master/repository</repository> </repositories> </androidPackage>Please make sure that the Geniee SDK file to be used has the following library created under
Assets>Plugins>Android.- jp.co.geniee.gnsrewardadapter.GNSRewardAdapter-UnityAds-3.0.0.aar
Please confirm that the following network is created under
Assets>Plugins>Androidfor the ad network SDK file to be used.- com.unity3d.ads.unity-ads-2.2.0.aar
Implementation of AdColony
<!-- GNSRewardAdapter AdColony --> <androidPackage spec="jp.co.geniee.gnsrewardadapter:GNSRewardAdapter-AdColony:3.0.0"> <androidSdkPackageIds> <androidSdkPackageId>extra-geniee-repository</androidSdkPackageId> </androidSdkPackageIds> <repositories> <repository>https://raw.github.com/geniee-ssp/Geniee-Android-SDK/master/repository</repository> <repository>https://adcolony.bintray.com/AdColony/</repository> </repositories> </androidPackage>Please make sure that the Geniee SDK file to be used has the following library created under
Assets>Plugins>Android.- jp.co.geniee.gnsrewardadapter.GNSRewardAdapter-AdColony-3.0.0.aar
Please confirm that the following network is created under
Assets>Plugins>Androidfor the ad network SDK file to be used.- com.adcolony.sdk-3.3.5.aar
Implementation of CAReward
<!-- GNSRewardAdapter CAReward --> <androidPackage spec="jp.co.geniee.gnsrewardadapter:GNSRewardAdapter-CAReward:3.0.0"> <androidSdkPackageIds> <androidSdkPackageId>extra-geniee-repository</androidSdkPackageId> </androidSdkPackageIds> <repositories> <repository>https://raw.github.com/geniee-ssp/Geniee-Android-SDK/master/repository</repository> </repositories> </androidPackage>Please make sure that the Geniee SDK file to be used has the following library created under
Assets>Plugins>Android.- jp.co.geniee.gnsrewardadapter.GNSRewardAdapter-CAReward-3.0.0.aar
Please add the library of the ad network to be used from
RewardVideo-Adnws-Android-SDKtoAssets>Plugins>Android.- MediaSDK_ver_2_4_0.jar
※ For details on
RewardVideo-Adnws-Android-SDK, please contact your sales representative.Implementation of Tapjoy
<!-- GNSRewardAdapter Tapjoy --> <androidPackage spec="jp.co.geniee.gnsrewardadapter:GNSRewardAdapter-Tapjoy:3.0.0"> <androidSdkPackageIds> <androidSdkPackageId>extra-geniee-repository</androidSdkPackageId> </androidSdkPackageIds> <repositories> <repository>https://raw.github.com/geniee-ssp/Geniee-Android-SDK/master/repository</repository> </repositories> </androidPackage>Please make sure that the Geniee SDK file to be used has the following library created under
Assets>Plugins>Android.- jp.co.geniee.gnsrewardadapter.GNSRewardAdapter-Tapjoy-3.0.0.aar
Please confirm that the following network is created under
Assets>Plugins>Androidfor the ad network SDK file to be used.- com.tapjoy.tapjoy-android-sdk-12.0.0.aar
Implementation of Vungle
<!-- GNSRewardAdapter Vungle --> <androidPackage spec="jp.co.geniee.gnsrewardadapter:GNSRewardAdapter-Vungle:3.0.0"> <androidSdkPackageIds> <androidSdkPackageId>extra-geniee-repository</androidSdkPackageId> </androidSdkPackageIds> <repositories> <repository>https://raw.github.com/geniee-ssp/Geniee-Android-SDK/master/repository</repository> <repository>https://jitpack.io/</repository> </repositories> </androidPackage>-->Please make sure that the Geniee SDK file to be used has the following library created under
Assets>Plugins>Android.- jp.co.geniee.gnsrewardadapter.GNSRewardAdapter-Vungle-3.0.0.aar
Please confirm that the following network is created under
Assets>Plugins>Androidfor the ad network SDK file to be used.- com.github.vungle.vungle-android-sdk-6.3.17.aar
- com.google.code.gson.gson-2.7.jar
- com.squareup.okhttp3.logging-interceptor-3.7.0.jar
- com.squareup.okhttp3.okhttp-3.7.0.jar
- com.squareup.okio.okio-1.12.0.jar
- com.squareup.retrofit2.converter-gson-2.2.0.jar
- com.squareup.retrofit2.retrofit-2.2.0.jar
- com.tonyodev.fetch.fetch-1.1.5.aar
- net.vrallev.android.cat-1.0.5.aar
Implementation of Nend
<!-- GNSRewardAdapter Nend --> <androidPackage spec="jp.co.geniee.gnsrewardadapter:GNSRewardAdapter-Nend:3.0.0"> <androidSdkPackageIds> <androidSdkPackageId>extra-geniee-repository</androidSdkPackageId> </androidSdkPackageIds> <repositories> <repository>https://raw.github.com/geniee-ssp/Geniee-Android-SDK/master/repository</repository> <repository>http://fan-adn.github.io/nendSDK-Android-lib/library/</repository> </repositories> </androidPackage>Please make sure that the Geniee SDK file to be used has the following library created under
Assets>Plugins>Android.- jp.co.geniee.gnsrewardadapter.GNSRewardAdapter-Nend-3.0.0.aar
Please confirm that the following network is created under
Assets>Plugins>Androidfor the ad network SDK file to be used.- net.nend.android.nend-sdk-5.0.2.aar
Implementation of AMoAd
<!-- GNSRewardAdapter Amoad --> <androidPackage spec="jp.co.geniee.gnsrewardadapter:GNSRewardAdapter-Amoad:3.0.0"> <androidSdkPackageIds> <androidSdkPackageId>extra-geniee-repository</androidSdkPackageId> </androidSdkPackageIds> <repositories> <repository>https://raw.github.com/geniee-ssp/Geniee-Android-SDK/master/repository</repository> </repositories> </androidPackage>Please make sure that the Geniee SDK file to be used has the following library created under
Assets>Plugins>Android.- jp.co.geniee.gnsrewardadapter.GNSRewardAdapter-Amoad-3.0.0.aar
Please add the library of the ad network to be used from
RewardVideo-Adnws-Android-SDKtoAssets>Plugins>Android.- AMoAd-playable-1.0.0.jar
※ For details on
RewardVideo-Adnws-Android-SDK, please contact your sales representative.
If you followed the Introducing libraries with Maven procedure, you do not need to do this step.
Manual introduction procedure here
Please add SDK below Assets>Plugins>Android directory.
- GNAdSDK-X.X.X.jar
- GNAdDFPRewardMediationAdapter-X.X.X.jar
- GNSRewardAdapter-AdColony-3.0.0.jar
- GNSRewardAdapter-Amoad-3.0.0.jar
- GNSRewardAdapter-AppLovin-3.0.0.jar
- GNSRewardAdapter-CAReward-3.0.0.jar
- GNSRewardAdapter-Maio-3.0.0.jar
- GNSRewardAdapter-Nend-3.0.0.jar
- GNSRewardAdapter-Tapjoy-3.0.0.jar
- GNSRewardAdapter-UnityAds-3.0.0.jar
- GNSRewardAdapter-Vungle-3.0.0.jar
Please add the library of the ad network to be used from RewardVideo-Adnws-Android-SDK to Assets>Plugins>Android.
- AMoAd-playable-1.0.0.jar
- MediaSDK_ver_2_4_0.jar
- VNG-moat-mobile-app-kit-2.2.0.jar
- applovin-sdk-8.1.0.jar
- cat-1.0.5.jar
- converter-gson-2.2.0.jar
- fetch-1.1.5.jar
- gson-2.7.jar
- logging-interceptor-3.7.0.jar
- maio-1.1.6.aar
- nend-sdk-5.0.2.aar
- okhttp-3.7.0.jar
- okio-1.12.0.jar
- retrofit-2.2.0.jar
- tapjoyconnectlibrary-12.0.0.jar
- unity-ads-2.3.0.aar
- vungle-android-sdk-6.3.17.jar
※ For details on RewardVideo-Adnws-Android-SDK, please contact your sales representative.
Add the following setting to dependencies of Assets/Plugins/Android/mainTemplate.gradle.
dependencies {
compile 'com.adcolony:sdk:3.3.3'
}
Edit Assets -> Plugins -> Android -> AndroidManifest.xml.
Please add Activity below.
<activity android:name="jp.co.geniee.utgnsrewardvideo.ExtendsDfpUnityPlayerActivity"
android:label="@string/app_name"
>
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
<meta-data android:name="unityplayer.UnityActivity" android:value="true" />
</activity>
Add the following depending on the added ad network.
<!-- AppLovin -->
<meta-data
android:name="applovin.sdk.key"
android:value="YOUR_APPLOVIN_SDK_KEY_HERE" />
- Please add AppLovinSDK key to android: value.
- Name: applovin.sdk.key
- Please check with your sales representative for
Applovin key.
Manual introduction procedure here
<!-- AdColony -->
<activity android:name="com.adcolony.sdk.AdColonyInterstitialActivity"
android:configChanges="keyboardHidden|orientation|screenSize"
android:hardwareAccelerated="true"/>
<activity android:name="com.adcolony.sdk.AdColonyAdViewActivity"
android:configChanges="keyboardHidden|orientation|screenSize"
android:hardwareAccelerated="true"/>
<!-- AppLovin -->
<activity android:name="com.applovin.adview.AppLovinInterstitialActivity" android:configChanges="orientation|screenSize"/>
<activity android:name="com.applovin.adview.AppLovinConfirmationActivity" android:configChanges="orientation|screenSize"/>
<meta-data
android:name="applovin.sdk.key"
android:value="YOUR_APPLOVIN_SDK_KEY_HERE" />
- Please add AppLovinSDK key to android: value.
- Name: applovin.sdk.key
<!-- CAReward-->
<activity
android:name="jp.co.mediasdk.mscore.ui.videoAd.MSGVAActivity"
android:configChanges="orientation|keyboardHidden|screenSize"
android:hardwareAccelerated="true" />
<!-- Tapjoy -->
<activity
android:name="com.tapjoy.TJAdUnitActivity"
android:configChanges="orientation|keyboardHidden|screenSize"
android:hardwareAccelerated="true"
android:theme="@android:style/Theme.Translucent.NoTitleBar.Fullscreen" />
<activity
android:name="com.tapjoy.mraid.view.ActionHandler"
android:configChanges="orientation|keyboardHidden|screenSize" />
<activity
android:name="com.tapjoy.mraid.view.Browser"
android:configChanges="orientation|keyboardHidden|screenSize" />
<activity
android:name="com.tapjoy.TJContentActivity"
android:configChanges="orientation|keyboardHidden|screenSize"
android:theme="@android:style/Theme.Translucent.NoTitleBar"
android:hardwareAccelerated="true" />
It need to add the same configuration changes to the activities of the app
android:configChanges="orientation|keyboardHidden|screenSize"
Describe the permissions that the SDK uses in the manifest file. (Please add only those without description.)
<!--Required Permissions-->
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" android:maxSdkVersion="18" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<!--Optional Permissions-->
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<!--Vungle Activities-->
<activity
android:name="com.vungle.warren.ui.VungleActivity"
android:configChanges="keyboardHidden|orientation|screenSize|screenLayout|smallestScreenSize"
android:launchMode="singleTop"
android:theme="@android:style/Theme.NoTitleBar.Fullscreen" />
<activity
android:name="com.vungle.warren.ui.VungleFlexViewActivity"
android:configChanges="keyboardHidden|orientation|screenSize|screenLayout|smallestScreenSize"
android:hardwareAccelerated="true"
android:launchMode="singleTop"
android:theme="@android:style/Theme.Translucent.NoTitleBar" />
<!-- Amoad -->
<activity android:name="com.amoad.AMoAdInterstitialVideoActivity" />
- Select File -> Build Settings from the menu bar.
- Select Platform's
Android. - BuildSystem: Select
Gradle. - You can check the package build by
Build & Run.
- Unity Preferences -> If you do not describe the paths of
SDKandJDKof External Tools, please write before you create the package.
This UnityPlugin uses the Activity which inherited UnityPlayerActivity so that ad processing can be done when OnStart, OnResume, OnPause of Android Lifecycle. .
If you want to use your own Activity, add the following method and interface to your own Activity. .
- Methods and instances to add to Activity
// Add listener processing to do processing on onStart
@Override
protected void onStart() {
super.onStart();
}
// Add listener processing to do processing on onResume
@Override
protected void onResume() {
super.onResume();
RewardedVideoAd rewardBasedVideo = MobileAds.getRewardedVideoAdInstance(this);
rewardBasedVideo.resume(this);
}
// Add listener processing to do processing on onPause
@Override
protected void onPause() {
RewardedVideoAd rewardBasedVideo = MobileAds.getRewardedVideoAdInstance(this);
rewardBasedVideo.pause(this);
super.onPause();
}