- SurfaceView
- TextureView (Android 4.0+)
- View
Hardware accelerated View is over x4 faster than SurfaceView & TextureView.
package com.appnext.appnextsdk; import android.content.Context; import android.os.Bundle; import com.google.android.gms.ads.mediation.MediationAdRequest; import com.google.android.gms.ads.mediation.customevent.CustomEventInterstitial; import com.google.android.gms.ads.mediation.customevent.CustomEventInterstitialListener; public class AppnextAdMobAdapter implements CustomEventInterstitial { private CustomEventInterstitialListener mCustomEventInterstitialListener; private String mPlacementId; private Context mContext; @Override public void onDestroy() { } @Override public void onPause() { } @Override public void onResume() { } @Override public void requestInterstitialAd(Context context, CustomEventInterstitialListener listener, String serverParameter, MediationAdRequest mediationAdRequest, Bundle customEventExtras) { mContext = context; mPlacementId = serverParameter; mCustomEventInterstitialListener = listener; if (mCustomEventInterstitialListener != null) mCustomEventInterstitialListener.onAdLoaded(); } @Override public void showInterstitial() { PopupActivity.setAdLoadInterface(new OnAdLoadInterface() { @Override public void adLoaded() { if (mCustomEventInterstitialListener != null) mCustomEventInterstitialListener.onAdLoaded(); } }); PopupActivity.setNoAdsInterface(new NoAdsInterface() { @Override public void noAds() { if (mCustomEventInterstitialListener != null) mCustomEventInterstitialListener.onAdFailedToLoad(0); } }); PopupActivity.setPopupOpenedInterface(new PopupOpenedInterface() { @Override public void popupOpened() { if (mCustomEventInterstitialListener != null) mCustomEventInterstitialListener.onAdOpened(); } }); PopupActivity.setPopupClickedCallback(new PopupClickedInterface() { @Override public void popupClicked() { if (mCustomEventInterstitialListener != null) mCustomEventInterstitialListener.onAdClicked(); } }); PopupActivity.setPopupClosedCallback(new PopupClosedInterface() { @Override public void popupClosed() { if (mCustomEventInterstitialListener != null) mCustomEventInterstitialListener.onAdClosed(); } }); Appnext.showPopupInActivity(mContext, mPlacementId, false); } }