Android package build instructions

Please follow the build procedure below.

  1. Library addition with gradle
  2. Manual library addition
  3. Edit AndroidManifest.xml
  4. Build procedure

Introducing libraries with gradle

  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
    • GNSExtendsUnityPlayerActivity.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-gcm:15.0.1'
implementation 'com.google.android.gms:play-services-location:15.0.1'
1
2
3
4
5
6
7
  1. Open PlayServicesResolver/Editor/GNDependencies and get the following to get GNAdSDK.
<!-- 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
11

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.gnadsdk:GNAdSDK:8.5.1'
1
2
  1. Open PlayServicesResolver>Editor> GNDependencies and addGNSFullscreenInterstitialAdapter by adding the following. We will change the description by Ad Network.
When installing all the ad networks collectively
<!-- GNSFullscreenInterstitialAdapter All ADNW-->
<androidPackage spec="jp.co.geniee.gnsfullscreeninterstitialadapter:GNSFullscreenInterstitialAdapter:4.3.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>
        <repository>https://imobile-maio.github.io/maven/</repository>
        <repository>https://github.com/zucks/ZucksAdNetworkSDK-Maven/raw/master/</repository>
    </repositories>
</androidPackage>

1
2
3
4
5
6
7
8
9
10
11
12
13
14

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.gnsfullscreeninterstitialadapter:GNSFullscreenInterstitialAdapter-AppLovin:4.3.0'
implementation 'jp.co.geniee.gnsfullscreeninterstitialadapter:GNSFullscreenInterstitialAdapter-Imobile:4.3.0'
implementation 'jp.co.geniee.gnsfullscreeninterstitialadapter:GNSFullscreenInterstitialAdapter-Maio:4.3.0'
implementation 'jp.co.geniee.gnsfullscreeninterstitialadapter:GNSFullscreenInterstitialAdapter-Nend:4.3.0'
implementation 'jp.co.geniee.gnsfullscreeninterstitialadapter:GNSFullscreenInterstitialAdapter-Tapjoy:4.3.0'
implementation 'jp.co.geniee.gnsfullscreeninterstitialadapter:GNSFullscreenInterstitialAdapter-UnityAds:4.3.0'
implementation 'jp.co.geniee.gnsfullscreeninterstitialadapter:GNSFullscreenInterstitialAdapter-Vungle:4.3.0'
implementation 'jp.co.geniee.gnsfullscreeninterstitialadapter:GNSFullscreenInterstitialAdapter-Zucks:4.3.0'
1
2
3
4
5
6
7
8
9

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

  • net.zucks.zucks-ad-network-sdk-4.7.0.jar
  • com.applovin.applovin-sdk-9.14.5.aar
  • com.maio.android-sdk-1.1.13.aar
  • net.nend.android.nend-sdk-5.4.2.aar
  • com.tapjoy.tapjoy-android-sdk-12.7.0.aar
  • com.unity3d.ads.unity-ads-3.4.8.aar
  • com.vungle.publisher-sdk-android-6.8.0.aar
Implementation of Maio
<!-- GNSFullscreenInterstitialAdapter Maio -->
<androidPackage spec="jp.co.geniee.gnsfullscreeninterstitialadapter:GNSFullscreenInterstitialAdapter-Maio:4.3.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>
1
2
3
4
5
6
7
8
9
10
11

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

  • jp.co.geniee.gnsfullscreeninterstitialadapter.GNSFullscreenInterstitialAdapter-Maio-4.3.0.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.13.aar
Implementation of AppLovin
<!-- GNSFullscreenInterstitialAdapter AppLovin -->
<androidPackage spec="jp.co.geniee.gnsfullscreeninterstitialadapter:GNSFullscreenInterstitialAdapter-AppLovin:4.3.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
10

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

  • jp.co.geniee.gnsfullscreeninterstitialadapter.GNSFullscreenInterstitialAdapter-AppLovin-4.3.0.aar
  • com.applovin.applovin-sdk-9.14.5.aar
Implementation of Nend
<!-- GNSFullscreenInterstitialAdapter Nend -->
<androidPackage spec="jp.co.geniee.gnsfullscreeninterstitialadapter:GNSFullscreenInterstitialAdapter-Nend:4.3.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>
1
2
3
4
5
6
7
8
9
10
11

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

  • jp.co.geniee.gnsfullscreeninterstitialadapter.GNSFullscreenInterstitialAdapter-Nend-4.3.0.aar
  • net.nend.android.nend-sdk-5.4.2.aar
Implementation of Zucks
<!-- GNSFullscreenInterstitialAdapter Zucks -->
<androidPackage spec="jp.co.geniee.gnsfullscreeninterstitialadapter:GNSFullscreenInterstitialAdapter-Zucks:4.3.0">
    <androidSdkPackageIds>
        <androidSdkPackageId>extra-geniee-repository</androidSdkPackageId>
    </androidSdkPackageIds>
    <repositories>
        <repository>https://raw.github.com/geniee-ssp/Geniee-Android-SDK/master/repository</repository>
        <repository>https://github.com/zucks/ZucksAdNetworkSDK-Maven/raw/master/</repository>
    </repositories>
</androidPackage>
1
2
3
4
5
6
7
8
9
10
11

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

  • jp.co.geniee.gnsfullscreeninterstitialadapter.GNSFullscreenInterstitialAdapter-Zucks-4.3.0.aar
  • net.zucks.zucks-ad-network-sdk-4.7.0.jar
Implementation of Tapjoy
<!-- GNSFullscreenInterstitialAdapter Tapjoy -->
<androidPackage spec="jp.co.geniee.gnsfullscreeninterstitialadapter:GNSFullscreenInterstitialAdapter-Tapjoy:4.3.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
10

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

  • jp.co.geniee.gnsfullscreeninterstitialadapter.GNSFullscreenInterstitialAdapter-Tapjoy-4.3.0.aar
  • com.tapjoy.tapjoy-android-sdk-12.7.0.aar
Implementation of UnityAds
<!-- GNSFullscreenInterstitialAdapter UnityAds -->
<androidPackage spec="jp.co.geniee.gnsfullscreeninterstitialadapter:GNSFullscreenInterstitialAdapter-UnityAds:4.3.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
10

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

  • jp.co.geniee.gnsfullscreeninterstitialadapter.GNSFullscreenInterstitialAdapter-UnityAds-4.3.0.aar
  • com.unity3d.ads.unity-ads-3.4.8.aar
Implementation of Vungle
<!-- GNSFullscreenInterstitialAdapter Vungle -->
<androidPackage spec="jp.co.geniee.gnsfullscreeninterstitialadapter:GNSFullscreenInterstitialAdapter-Vungle:4.3.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
10

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

  • jp.co.geniee.gnsfullscreeninterstitialadapter.GNSFullscreenInterstitialAdapter-Vungle-4.3.0.aar
  • com.vungle.publisher-sdk-android-6.8.0.aar
Implementation of Imobile
<!-- GNSFullscreenInterstitialAdapter Imobile -->
<androidPackage spec="jp.co.geniee.gnsfullscreeninterstitialadapter:GNSFullscreenInterstitialAdapter-Imobile:4.3.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
10

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

  • jp.co.geniee.gnsfullscreeninterstitialadapter.GNSFullscreenInterstitialAdapter-Imobile-4.3.0.aa

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

  • imobileSdkAds_2.0.20

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

Manually install libraries

If you followed the Installing libraries with Maven procedure, you do not need to do this step.

Click here for the manual installation procedure

Please add SDK below Assets> Plugins> directly under Android.

  • GNAdSDK-8.5.1.jar
  • GNSFullscreenInterstitialAdapter-AppLovin-4.3.0.jar
  • GNSFullscreenInterstitialAdapter-Zucks-4.3.0.jar
  • GNSFullscreenInterstitialAdapter-Nend-4.3.0.jar
  • GNSFullscreenInterstitialAdapter-Maio-4.3.0.jar
  • GNSFullscreenInterstitialAdapter-UnityAds-4.3.0.jar
  • GNSFullscreenInterstitialAdapter-Tapjoy-4.3.0.jar
  • GNSFullscreenInterstitialAdapter-Vungle-4.3.0.jar
  • GNSFullscreenInterstitialAdapter-Imobile-4.3.0.jar

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

  • applovin-sdk-9.14.5.aar
  • maio-1.1.13.aar
  • nend-sdk-5.4.2.aar
  • ZucksAdNetworkSDK-4.7.0.jar
  • tapjoyconnectlibrary-12.7.0.jar
  • publisher-sdk-android-6.8.0.jar
  • unity-ads-3.4.8.aar
  • imobileSdkAds_2.0.20.jar

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

2. Edit AndroidManifest.xml

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

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
  • Add AppLovinSDK key to android: value.
    • Name: applovin.sdk.key
    • Please check with your sales representative for Applovin key.

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

vungle

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

3. Build procedure

  1. Select File -> Build Settings from the menu bar.
  2. Select Platform's Android.
  3. BuildSystem: Select "Gradle".
  4. If you have not edited Bundle Identifier etc., press Player Settings and edit the necessary setting items.
  5. 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.

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. . And please set the interface name before doing ad processing (loading advertisement etc.).

  • Method, interface to add to Activity
private LifecycleListener lifecycleListener;

// Method to set the Listener. Method names and parameters are as follows and do not change.
public void setLifecycleListener(LifecycleListener listener) {
    this.lifecycleListener = listener;
}

// Add listener processing to do processing on onStart.
@Override
protected void onStart() {
    if (this.lifecycleListener != null) {
      this.lifecycleListener.onStart();
    }
    super.onStart();
}

// Add listener processing to do processing with onResume.
@Override
protected void onResume() {
    if (this.lifecycleListener != null) {
      this.lifecycleListener.onResume();
    }
    super.onResume();
}

// Add listener processing to do processing with onPause.
@Override
protected void onPause() {
    if (this.lifecycleListener != null) {
      this.lifecycleListener.onPause();
    }
    super.onPause();
}

// Add listener processing to do processing with onStop.
@Override
protected void onStop() {
    if (this.lifecycleListener != null) {
      this.lifecycleListener.onStop();
    }
    super.onStop();
}

// Please make a listener with the following three methods defined.
public interface LifecycleListener {
    void onStart();

    void onResume();

    void onPause();
    
    void onStop();
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
  • Setting the interface name
    // The class name is defined in the example. Please replace it with the name of the created interface.
    GNSAdSDK.Android.Utils.LifecycleListenerClassName = "jp.co.geniee.utgnsrewardvideo.ExtendsUnityPlayerActivity$LifecycleListener";
1
2
Last Updated: 11/10/2020, 2:55:13 PM