Android Getting Started Guide

This guide will explain how to install the Geniee ad SDK on your app.

Installation procedure:

  1. Preparation
  2. Introducing libraries in Maven
  3. Manually install the library
  4. Writing the manifest file

Preparation

To use the Geniee ad SDK, you must install the Google Play Services SDK. The Google Play Services SDK installation procedure is as follows.

  1. Add the following to dependencies ofModule> build.gradle.
dependencies {
    implementation 'com.google.android.gms:play-services-ads-identifier:17.0.0'
}
Points to note when introducing play-services-ads:17.0.0 or later

If you are introducing play-services-ads: 17.0.0, the application crashes unless you include the admob or Google Ad Manager tag in AndroidManifest.xml.

  • Tag of admob

    <manifest>
        <application>
            <!-- TODO: Replace with your real AdMob app ID -->
            <meta-data
                android:name="com.google.android.gms.ads.APPLICATION_ID"
                android:value="ca-app-pub-################~##########"/>
        </application>
    </manifest>
    
    1
    2
    3
    4
    5
    6
    7
    8
  • Tag of Google Ad Manager

    <manifest>
        <application>
            <meta-data
                android:name="com.google.android.gms.ads.AD_MANAGER_APP"
                android:value="true"/>
        </application>
    </manifest>
    
    1
    2
    3
    4
    5
    6
    7
  • When not using admob or Google Ad Manager

    If you do not use admob or Google Ad Manager (when using the Geniee SDK by itself), do not implement com.google.android.gms:play-services-ads, but instead callModule>build.gradle Add the following to dependencies.

    dependencies {
        implementation 'com.google.android.gms:play-services-ads-identifier:16.0.0'
    }
    
    1
    2
    3

Introducing libraries in Maven(Recommend)

  1. Add the following to allprojects> repositories inProject> build.gradle.
allprojects {
   	repositories {
   		maven { 
   			url 'http://raw.github.com/geniee-ssp/Geniee-Android-SDK/master/repository'
   		}
   	}
}  
1
2
3
4
5
6
7
  1. Add the following to Module>build.gradle in dependencies.
dependencies {
    implementation 'jp.co.geniee.gnadsdk:GNAdSDK:8.5.1'
}
  1. Implementation example
  • Project>build.gradle
allprojects {
   	repositories {
   		google()
   		jcenter()
   		// GenieeSDK
   		maven { 
   			url 'https://raw.github.com/geniee-ssp/Geniee-Android-SDK/master/repository'
   		}
   	}
}
   
1
2
3
4
5
6
7
8
9
10
11
  • Module>build.gradle
dependencies {
	implementation fileTree(include: ['*.jar'], dir: 'libs')
	implementation 'com.android.support:appcompat-v7:26.1.0'
	implementation 'com.android.support.constraint:constraint-layout:1.1.1'
        implementation 'com.google.android.gms:play-services-ads-identifier:17.0.0'
	//Geniee SDK
	implementation 'jp.co.geniee.gnadsdk:GNAdSDK:8.5.1'
}

Manually install the library

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

Click here for the manual installation procedure

Download Geniee SDK

Download Geniee Android SDK from the following URL.

Placing the jar library

  1. Unzip Geniee Android SDK.

  2. Add the advertisement SDK to the project.。

  • If the libs folder does not exist, create it as necessary.

  • Copy the GenieeAdsSDK / jar file to the libs folder.

    • GNAdSDK- <version_number> .jar
  • Add to 'dependencies' in app / build.gradle.

    • implementation files ('libs/GNAdSDK-8.5.1.jar')
  • Make sure that it is added to 'Dependencies' of 'Project Structure'.

    image

        dependencies {
            implementation fileTree(include: ['*.jar'], dir: 'libs')
            implementation 'com.android.support:appcompat-v7:26.1.0'
            implementation 'com.android.support.constraint:constraint-layout:1.1.1''
                implementation 'com.google.android.gms:play-services-ads-identifier:{{$version.android.playServicesAdsIdentifier}}'
        }
    
    1
    2
    3
    4
    5
    6

Description of manifest file

Write the necessary information in the manifest file AndroidManifest.xml.

Installing libraries with Maven, Installing libraries manually Writing a common manifest file

  1. Describe the Google Play Services SDK information used by the SDK. Write it in <application> of the manifest file.

    <meta-data android:name="com.google.android.gms.version"
    android:value="@integer/google_play_services_version"/>
    
    1
    2
  2. Other than RewardVideo,There is no problem with either ACCESS_COARSE_LOCATION or ACCESS_FINE_LOCATION description.

    • When the position information is not used, description is unnecessary.
    <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/>
    <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
    
    1
    2

Writing a manifest file when manually installing libraries is executed

  1. Write the following permissions.

    <uses-permission android:name="android.permission.INTERNET"/>
    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
    <uses-permission android:name="com.google.android.providers.gsf.permission.READ_GSERVICES" />
    
    1
    2
    3
  2. Describe the activity information used by the SDK.

    • Write it in <application> of the manifest file.

      • For Banner
      <!-- Banner -->
      <activity android:name="jp.co.geniee.gnadsdk.banner.GNAdWebActivity"
      android:label="@string/app_name" android:screenOrientation="portrait"/>
      
      1
      2
      3
      • For Interstitial
      <!-- Interstitial -->
      <activity android:name="jp.co.geniee.gnadsdk.interstitial.GNInterstitialActivity" 
      android:theme="@android:style/Theme.Translucent" 
      android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize" 
      android:screenOrientation="behind"/>
      
      1
      2
      3
      4
      5
      • For Video
      <!-- Video -->
      <activity android:name="jp.co.geniee.gnadsdk.video.GNVideoViewActivity" 
      android:theme="@android:style/Theme.Translucent" 
      android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize" 
      android:screenOrientation="unspecified"/>
      
      1
      2
      3
      4
      5
Last Updated: 9/7/2020, 1:30:18 PM