Android Implementation of AdMob/AdManager banner mediation
By using mediation function of AdMob/AdManager, you can distribute Geniee SDK banner from AdMob/AdManager.
Preparation for implementation
For banner advertisement, the following mounting preparation is necessary.
- Google Play Services SDK To use the Geniee ad SDK, you must install the Google Play Services SDK. The Google Play Services SDK installation procedure is as follows.
- Add the following to
dependencies
ofModule> build.gradle
.
dependencies {
implementation 'com.google.android.gms:play-services-ads:20.0.0'
}
If you have already installed the Google Play Services SDK, no addition is required.
Google Developers Official Site [Setting Up Google Play Services] (https://developers.google.com/android/guides/setup)
Make sure that it is added to
Dependencies
ofProject Structure
.
Geniee SDK
From the start guide below, you need to install Geniee SDK (
GNAdSDK
) in the application. Start Guide- When implementing AdMob/AdManager banner mediation, the Geniee SDK must be version 3.2.1 or higher.
Implementation of SDK for AdMob/AdManager banner mediation
When implementing with Maven(Recommend)
Add the following to
allprojects>repositories
inProject>build.gradle
.allprojects { repositories { // GenieeSDK maven { url 'https://raw.github.com/geniee-ssp/Geniee-Android-SDK/master/repository' } } }
1
2
3
4
5
6
7
8Add the following to
dependencies
ofModule> build.gradle
.dependencies { implementation 'jp.co.geniee.gnadgooglemediationadapter:GNAdGoogleMediationAdapter:8.5.0.0' }
Implementation example
Project>build.gradle
allprojects { repositories { jcenter() google() // GenieeSDK maven { url 'https://raw.github.com/geniee-ssp/Geniee-Android-SDK/master/repository' } } }
1
2
3
4
5
6
7
8
9
10Module>build.gradle
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
// Google SDK
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' // GenieeSDK
implementation 'jp.co.geniee.gnadgooglemediationadapter:GNAdGoogleMediationAdapter:8.5.0.0'
}
2
3
4
5
6
7
8
9
10
11
Introduce libraries manually
If you followed the Installing libraries with Maven
procedure, you do not need to do this step.
Manual introduction procedure here
Download Geniee Adapter SDK
Download Geniee Android SDK from the following URL.
Placing the Local Library
Extract Geniee Android SDK.
Add GNSRewardAdapter to the project.
If the
libs
folder does not exist, create it as necessary.Copy the following files under the
GNAdGoogleMediationAdapter
folder to thelibs
folder.GNAdGoogleMediationAdapter-8.5.0.0.jar
Add to
dependencies
ofModule/build.gradle
.
dependencies { implementation fileTree(include: ['*.jar'], dir: 'libs') }
1
2
3
Implementation of AdMob/AdManager banner advertisement
It is possible to mediate AdMob/AdManager by calling with the UnitID of the banner set up as mediation in AdMob/AdManager management screen.
For details on how to implement AdMob/AdManager's banner, refer to the following site.
https://developers.google.com/ad-manager/mobile-ads-sdk/android/banner
※ Implementation notes when using mediation
When creating the banner instantance, specify Activity instead of Context.
If you specify Context, mediation may not work.