Android Implementation of FullscreenInterstitial advertisement
Full screen interstitial advertisement is a full page advertisement displayed when the screen is switched by operation of the application, screen transition, etc. By displaying advertisements on screen transition, visibility of users can be improved.
You can also return to the original transition screen by pressing the X button(close button).
In GenieeSDK, mediation function displays FullscreenInterstitial advertisement of each ad network.
Preparation for implementation
For FullscreenInterstitial Advertisement, the following implementation preparation is necessary.
Geniee SDK
From the start guide below, you need to install Geniee SDK (
GNAdSDK
) in the application.Each Ad Network SDK and adapter
For fullscreen interstitial, it is necessary to set the SDK for each ad network and the adapter .
To set all the ad networks collectively, please refer to the following link introduction method.
Bulk Implementation of All Ad NetworksAlso, in order to use the ad network individually, please select the ad network link from the following and refer to the introduction method.
AD Network Verified version maio 1.1.13 AppLovin 9.14.5 Nend 5.4.2 Zucks 4.7.0 Tapjoy 12.7.0 UnityAds 3.4.8 Vungle 6.8.0 Imobile 2.0.20 GoogleAdx 20.0.0 AdColony 4.7.1 InMobi 9.2.0
Classes and Interfaces
For Android fullscreen ad serving, we use the following classes.
- GNSFullscreenInterstitialAd Get fullscreen interstitial advertisement asynchronously, display class
- GNSFullscreenInterstitialAdListener Fullscreen interstitial advertisement Interface for loading, playing, terminating
Implementation of FullscreenInterstitial reward advertisement
Import
GNSFullscreenInterstitialAd
.import jp.co.geniee.gnadsdk.fullscreeninterstitial.GNSFullscreenInterstitialAd; import jp.co.geniee.gnadsdk.fullscreeninterstitial.GNSFullscreenInterstitialAdListener; import jp.co.geniee.gnadsdk.common.GNSException;
1
2
3Create an instance of
GNSFullscreenInterstitialAd
withZoneID
.private GNSFullscreenInterstitialAd mFullscreenInterstitial; setContentView(R.layout.activity_main); mFullscreenInterstitial = new GNSFullscreenInterstitialAd("YOUR_ZONE_ID", MainActivity.this);
1
2
3
4Implement the
GNSFullscreenInterstitialAdListener
interface.mFullscreenInterstitial.setFullscreenInterstitialAdListener(new GNSFullscreenInterstitialAdListener() { @Override public void fullscreenInterstitialAdDidReceiveAd() { Log.i("GNSFullscreen", "Fullscreen ad load success"); } @Override public void fullscreenInterstitialAdWillPresentScreen(String adName) { Log.i("GNSFullscreen", "Fullscreen ad showing (" + adName + ")"); } @Override public void fullscreenInterstitialAdDidClose(String adName) { Log.i("GNSFullscreen", "Fullscreen ad has been closed(" + adName + ")"); } @Override public void didFailToLoadWithError(GNSVideoRewardException e) { Log.i("GNSFullscreen", "Fulscreen interstitial ad load failed.(" + e.getAdnetworkName() + " Code:" + e.getCode() + " " + e.getMessage()); } });
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21Implement the
loadRequest
method of fullscreen interstitial.mFullscreenInterstitial.loadRequest();
1- Load requests can take several seconds or more, so please request ads as soon as possible.
- If you want to show another ad after presented one video, you need to make a load request again.
Confirm that
loadRequest
method completed successfully withcanShow
method and show ad withshow
method.if (mFullscreenInterstitial.canShow()) { mFullscreenInterstitial.show(); } else { Log.i("GNSFullscreen", "Fullscreen interstitial ad is loading"); }
1
2
3
4
5- Be sure to perform the show after executing loadRequest.
We will link the activity life cycle to the process. This stitching is used to control stop and restart of advertisements.
@Override protected void onStart() { super.onStart(); if (mFullscreenInterstitial != null) { mFullscreenInterstitial.onStart(); } } @Override protected void onResume() { super.onResume(); if (mFullscreenInterstitial != null) { mFullscreenInterstitial.onResume(); } } @Override protected void onPause() { if (mFullscreenInterstitial != null) { mFullscreenInterstitial.onPause(); } super.onPause(); } @Override protected void onStop() { if (mFullscreenInterstitial != null) { mFullscreenInterstitial.onStop(); } super.onStop(); } @Override protected void onDestroy() { if (mFullscreenInterstitial != null) { mFullscreenInterstitial.onDestroy(); } super.onDestroy(); }
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
- When using fullscreen interstitial ad for the whole application
Please exclude the implementation of mFullscreenInterstitial.onDestroy ().
If you implement
mFullscreenInterstitial.onDestroy ()
data of interstitial ad will be destroyed.
Implementation method to display advertisement with higher unit price than
By displaying advertisements after several tens of seconds from the ad ready event, we may increase unit price. This is because, when requesting a plurality of advertisements at the same time to prepare the first advertisement, the application side is notified of the preparation completion, and there is a possibility that the advertisement with a higher unit price becomes ready in a few seconds thereafter That is why. Therefore, by receiving the advertisement acquisition process in advance, it is possible to acquire a higher unit price advertisement.