Android package build instructions

Please follow the build procedure below.

  1. gradle addition with Library
    • Introducing libraries in Maven
    • Add library manually
  2. Edit AndroidManifest.xml
    1. Connect the life cycle of Unity Activity to GNSAdSDK
    2. Added various ad networks
  3. Build procedure
  4. When using your own Activity

1. Add library with gradle

Introducing libraries with Maven

  1. Open File>Build Settings ... on the menu bar and set the following.

    • Platform: Android
    • Build System: Gradle
  2. Make sure that the following library is created under Assets> Plugins> Android file to be used.

    • AndroidManifest.xml
    • GNSExtendsDfpUnityPlayerActivity.jar
    • mainTemplate.gradle
  3. Make sure that the Android Library file to be used has generated the following library in Assets/Plugins/Android/mainTemplate.gradle.

implementation 'androidx.appcompat:appcompat:1.1.0'
implementation 'androidx.cardview:cardview:1.0.0'
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
implementation 'androidx.multidex:multidex:2.0.1'
implementation 'androidx.percentlayout:percentlayout:1.0.0'
implementation 'com.google.android.gms:play-services-ads:18.2.0'
implementation 'com.google.android.gms:play-services-gcm:17.0.0'
implementation 'com.google.android.gms:play-services-location:17.0.0'
1
2
3
4
5
6
7
8
  1. Open PlayServicesResolver/Editor/GNDependencies and get the GNAdSDK by writing:
<!-- GNAdSDK -->
<androidPackage spec="jp.co.geniee.gnadsdk:GNAdSDK:8.5.1">
<androidSdkPackageIds>
    <androidSdkPackageId>extra-geniee-repository</androidSdkPackageId>
  </androidSdkPackageIds>
  <repositories>
    <repository>https://raw.github.com/geniee-ssp/Geniee-Android-SDK/master/repository</repository>
  </repositories>
</androidPackage>
1
2
3
4
5
6
7
8
9
10

Please make sure that the Geniee SDK file to be used has the following library created under Assets>Plugins>Android.

implementation 'jp.co.geniee.gnadsdk:GNAdSDK:8.5.1'
1
2
  1. Open PlayServicesResolver/Editor/GNDependencies and get the GNAdGoogleMediationAdapter by writing:
<androidPackage spec="jp.co.geniee.gnadgooglemediationadapter:GNAdGoogleMediationAdapter:8.5.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>
1
2
3
4
5
6
7
8
9

Make sure that the following libraries are generated in the Geneese SDK file to be used in Assets/Plugins/Android/mainTemplate.gradle.

implementation 'jp.co.geniee.gnadgooglemediationadapter:GNAdGoogleMediationAdapter:8.5.0.0'
1
2
  1. Open PlayServicesResolver/Editor/GNDependencies and installGNSRewardAdapter by 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:6.4.1">
    <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>
        <repository>https://imobile-maio.github.io/maven/</repository>
        <repository>https://adcolony.bintray.com/AdColony/</repository>
      </repositories>
</androidPackage>
1
2
3
4
5
6
7
8
9
10
11
12
13

Make sure that the following libraries are generated in the Geneese SDK file to be used in Assets/Plugins/Android/mainTemplate.gradle.

implementation 'jp.co.geniee.gnsrewardadapter:GNSRewardAdapter-AdColony:6.4.1'
implementation 'jp.co.geniee.gnsrewardadapter:GNSRewardAdapter-Amoad:6.4.1'
implementation 'jp.co.geniee.gnsrewardadapter:GNSRewardAdapter-AppLovin:6.4.1'
implementation 'jp.co.geniee.gnsrewardadapter:GNSRewardAdapter-CAReward:6.4.1'
implementation 'jp.co.geniee.gnsrewardadapter:GNSRewardAdapter-Maio:6.4.1'
implementation 'jp.co.geniee.gnsrewardadapter:GNSRewardAdapter-Nend:6.4.1'
implementation 'jp.co.geniee.gnsrewardadapter:GNSRewardAdapter-Tapjoy:6.4.1'
implementation 'jp.co.geniee.gnsrewardadapter:GNSRewardAdapter-TikTok:6.4.1'
implementation 'jp.co.geniee.gnsrewardadapter:GNSRewardAdapter-UnityAds:6.4.1'
implementation 'jp.co.geniee.gnsrewardadapter:GNSRewardAdapter-Vungle:6.4.1'
1
2
3
4
5
6
7
8
9
10
11

Please confirm that the following network is created under Assets>Plugins>Android for the ad network SDK file to be used.

  • com.adcolony.sdk-4.7.1.aar

  • com.applovin.applovin-sdk-9.14.5.aar

  • com.maio.android-sdk-1.1.13.aar

  • com.tapjoy.tapjoy-android-sdk-12.7.0.aar

  • com.tonyodev.fetch.fetch-1.1.5.aar

  • com.unity3d.ads.unity-ads-3.4.8.aar

  • net.nend.android.nend-sdk-5.4.2.aar

  • com.vungle.vungle-android-sdk-6.8.0.aar

  • com.google.code.gson.gson-2.8.6.jar

  • com.squareup.okhttp3.okhttp-3.12.12.jar

  • com.squareup.okio.okio-1.15.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
    • tiktok_ad_sdk-2.0.0.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:6.4.1">
    <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>
1
2
3
4
5
6
7
8
9
10
11

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-6.4.1.aar

Please confirm that the following network is created under Assets>Plugins>Android for 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:6.4.1">
    <androidSdkPackageIds>
        <androidSdkPackageId>extra-geniee-repository</androidSdkPackageId>
      </androidSdkPackageIds>
      <repositories>
        <repository>https://raw.github.com/geniee-ssp/Geniee-Android-SDK/master/repository</repository>
      </repositories>
</androidPackage>
1
2
3
4
5
6
7
8
9
10

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-6.4.1.aar

Please confirm that the following network is created under Assets>Plugins>Android for the ad network SDK file to be used.

  • com.applovin.applovin-sdk-9.14.5.aar
Implementation of UnityAds
<!-- GNSRewardAdapter UnityAds -->
<androidPackage spec="jp.co.geniee.gnsrewardadapter:GNSRewardAdapter-UnityAds:6.4.1">
    <androidSdkPackageIds>
        <androidSdkPackageId>extra-geniee-repository</androidSdkPackageId>
      </androidSdkPackageIds>
      <repositories>
        <repository>https://raw.github.com/geniee-ssp/Geniee-Android-SDK/master/repository</repository>
      </repositories>
</androidPackage>
1
2
3
4
5
6
7
8
9
10

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-6.4.1.aar

Please confirm that the following network is created under Assets>Plugins>Android for the ad network SDK file to be used.

  • com.unity3d.ads.unity-ads-3.4.8.aar
Implementation of AdColony
<!-- GNSRewardAdapter AdColony -->
<androidPackage spec="jp.co.geniee.gnsrewardadapter:GNSRewardAdapter-AdColony:6.4.1">
    <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>
1
2
3
4
5
6
7
8
9
10
11

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-6.4.1.aar

Please confirm that the following network is created under Assets>Plugins>Android for the ad network SDK file to be used.

  • com.adcolony.sdk-4.7.1.aar
Implementation of CAReward
<!-- GNSRewardAdapter CAReward -->
<androidPackage spec="jp.co.geniee.gnsrewardadapter:GNSRewardAdapter-CAReward:6.4.1">
    <androidSdkPackageIds>
        <androidSdkPackageId>extra-geniee-repository</androidSdkPackageId>
      </androidSdkPackageIds>
      <repositories>
        <repository>https://raw.github.com/geniee-ssp/Geniee-Android-SDK/master/repository</repository>
      </repositories>
</androidPackage>
1
2
3
4
5
6
7
8
9
10

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-6.4.1.aar

Please add the library of the ad network to be used from RewardVideo-Adnws-Android-SDK to Assets>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:6.4.1">
    <androidSdkPackageIds>
        <androidSdkPackageId>extra-geniee-repository</androidSdkPackageId>
      </androidSdkPackageIds>
      <repositories>
        <repository>https://raw.github.com/geniee-ssp/Geniee-Android-SDK/master/repository</repository>
      </repositories>
</androidPackage>
1
2
3
4
5
6
7
8
9
10

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-6.4.1.aar

Please confirm that the following network is created under Assets>Plugins>Android for the ad network SDK file to be used.

  • com.tapjoy.tapjoy-android-sdk-12.7.0.aar
Implementation of Vungle
<!-- GNSRewardAdapter Vungle -->
<androidPackage spec="jp.co.geniee.gnsrewardadapter:GNSRewardAdapter-Vungle:6.4.1">
    <androidSdkPackageIds>
        <androidSdkPackageId>extra-geniee-repository</androidSdkPackageId>
      </androidSdkPackageIds>
      <repositories>
        <repository>https://raw.github.com/geniee-ssp/Geniee-Android-SDK/master/repository</repository>
      </repositories>
</androidPackage>
1
2
3
4
5
6
7
8
9
10

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-6.4.1.aar

Please confirm that the following network is created under Assets>Plugins>Android for the ad network SDK file to be used.

  • com.vungle.publisher-sdk-android-6.8.0.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:6.4.1">
    <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>
1
2
3
4
5
6
7
8
9
10
11

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-6.4.1.aar

Please confirm that the following network is created under Assets>Plugins>Android for the ad network SDK file to be used.

  • net.nend.android.nend-sdk-5.4.2.aar
Implementation of AMoAd
<!-- GNSRewardAdapter Amoad -->
<androidPackage spec="jp.co.geniee.gnsrewardadapter:GNSRewardAdapter-Amoad:6.4.1">
    <androidSdkPackageIds>
        <androidSdkPackageId>extra-geniee-repository</androidSdkPackageId>
      </androidSdkPackageIds>
      <repositories>
        <repository>https://raw.github.com/geniee-ssp/Geniee-Android-SDK/master/repository</repository>
      </repositories>
</androidPackage>
1
2
3
4
5
6
7
8
9
10

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-6.4.1.aar

    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

    ※ For details on RewardVideo-Adnws-Android-SDK, please contact your sales representative.

Implementation of TikTok
<!-- GNSRewardAdapter TikTok -->
<androidPackage spec="jp.co.geniee.gnsrewardadapter:GNSRewardAdapter-TikTok:6.4.1">
  <androidSdkPackageIds>
      <androidSdkPackageId>extra-geniee-repository</androidSdkPackageId>
    </androidSdkPackageIds>
    <repositories>
      <repository>https://raw.github.com/geniee-ssp/Geniee-Android-SDK/master/repository</repository>
    </repositories>
</androidPackage>
1
2
3
4
5
6
7
8
9
10

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-TikTok-6.4.1.aar

Please add the library of the ad network to be used from RewardVideo-Adnws-Android-SDK to Assets>Plugins>Android.

  • tiktok_ad_sdk-2.0.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-8.5.1.jar
  • GNAdGoogleMediationAdapter-8.5.0.0.jar
  • GNSRewardAdapter-AdColony-6.4.1.jar
  • GNSRewardAdapter-Amoad-6.4.1.jar
  • GNSRewardAdapter-AppLovin-6.4.1.jar
  • GNSRewardAdapter-CAReward-6.4.1.jar
  • GNSRewardAdapter-Maio-6.4.1.jar
  • GNSRewardAdapter-Nend-6.4.1.jar
  • GNSRewardAdapter-Tapjoy-6.4.1.jar
  • GNSRewardAdapter-UnityAds-6.4.1.jar
  • GNSRewardAdapter-Vungle-6.4.1.jar
  • GNSRewardAdapter-TikTok-6.4.1.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
  • applovin-sdk-9.14.5.aar
  • maio-1.1.13.aar
  • nend-sdk-5.4.2.aar
  • tapjoyconnectlibrary-12.7.0.jar
  • unity-ads-3.4.8.aar
  • tiktok_ad_sdk-2.0.0.0.jar
  • VNG-moat-mobile-app-kit-2.6.3.jar
  • gson-2.8.6.jar
  • okhttp-3.12.12.jar
  • okio-1.15.0.jar
  • vungle-android-sdk-6.8.0.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:{{$version.android.mediationAdColony}}'
}
1
2
3

2. Edit AndroidManifest.xml

Edit Assets -> Plugins -> Android -> AndroidManifest.xml.

Join Unity Activity's life cycle to GNSAdSDK

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>
1
2
3
4
5
6
7
8
9
10

Add various ad networks

Add the following depending on the added ad network.

applovin

<!-- AppLovin -->
<meta-data
     android:name="applovin.sdk.key"
     android:value="YOUR_APPLOVIN_SDK_KEY_HERE" />
1
2
3
4
5
  • 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

<!-- 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"/>
1
2
3
4
5
6
7
8

applovin

<!-- 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" />
1
2
3
4
5
6
7
  • Please add AppLovinSDK key to android: value.
    • Name: applovin.sdk.key

CAReward

<!-- CAReward-->
<activity
     android:name="jp.co.mediasdk.mscore.ui.videoAd.MSGVAActivity"
     android:configChanges="orientation|keyboardHidden|screenSize"
     android:hardwareAccelerated="true" />
1
2
3
4
5
6

Tapjoy

<!-- 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.TJContentActivity"
     android:configChanges="orientation|keyboardHidden|screenSize"
     android:theme="@android:style/Theme.Translucent.NoTitleBar"
     android:hardwareAccelerated="true" />
1
2
3
4
5
6
7
8
9
10
11
12

It need to add the same configuration changes to the activities of the app

android:configChanges="orientation|keyboardHidden|screenSize"
1

Vungle

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" />
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22

AMoAd

<!-- Amoad -->
<activity android:name="com.amoad.AMoAdInterstitialVideoActivity" />
1
2
3

TikTok

<!-- TikTok -->
<provider
	android:name="com.bytedance.sdk.openadsdk.multipro.TTMultiProvider"
	android:authorities="${applicationId}.TTMultiProvider"
	android:exported="false" />
1
2
3
4
5

3. Build procedure

  1. Select File -> Build Settings from the menu bar.
  2. Select Platform's Android.
  3. BuildSystem: Select Gradle.
  4. You can check the package build by Build & Run.
  • Unity Preferences -> If you do not describe the paths of SDK andJDK of External Tools, please write before you create the package.

4. When using your own Activity

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();
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
Last Updated: 11/11/2020, 9:41:13 AM