Before proceeding this chapter, be sure that you already finished SDK settings. If not, check 3) Android Settings first. [Incentive Interstitial Ad] To display incentive interstitial ads in your app, simply write down two lines of code as follows. [Non-Incentive Intestitial Ad] To display non-incentive interstitial ads in your app, simply write down two lines of code as follows. [TnkAdListener] To catch events when an interstitial ad is loaded or users close interstitial ads, use TnkAdListener interface. prepareInterstitialAd() and showInterstitialAd() method can have TnkAdListener object as last parameter. Following sample code shows that developer can control displaying interstitial ads. [Interstitial Ad APIs] API specs for prepareInterstitialAd() and showInterstitialAd(). - TnkSession.prepareInterstitialAd()Method - void TnkSession.prepareInterstitialAd(Activity activity, String displayLogic) - void TnkSession.prepareInterstitialAd(Activity activity, String displayLogic, TnkAdListener listener) Description It loads a single interstitial Ad from server and cache it in memory. Parameters
- TnkSession.showInterstitialAd()Method - void TnkSession.showInterstitialAd(Activity activity) - void TnkSession.showInterstitialAd(Activity activity, TnkAdListener listener) - void TnkSession.showInterstitialAd(Activity activity, long timeoutMillis) - void TnkSession.showInterstitialAd(Activity activity, long timeoutMillis, TnkAdListener listener) Description It displays an interstitial ad which is loaded by prepareInterstitialAd() call before. TnkAdListener.onShow() is invoked when the ads is successfully displayed on screen and TnkAdListener.onFailure() is invoked when the ads is not loaded in timeoutMillis (default is 5000 millisecs). Parameters
|
4. Interstitial Ad >