public async Task bannerView() { if (!AppStats.Current.ShouldShowInterstitials) { return; } advertisements = FindViewById <LinearLayout>(Resource.Id.advertisement); Context con = advertisements.Context; { _bannerad = AdWrapper.ConstructStandardBanner(con, AdSize.SmartBanner, "ca-app-pub-3167302081266616/1445459882"); var listener = new adlistener(); listener.AdLoaded += () => { }; _bannerad.AdListener = listener; _bannerad.CustomBuild(); var layout = FindViewById <LinearLayout>(Resource.Id.adbox); layout.AddView(_bannerad); var FinalAd = AdWrapper.ConstructFullPageAdd(con, "ca-app-pub-3167302081266616/1445459882"); var intlistener = new adlistener(); intlistener.AdLoaded += () => { if (FinalAd.IsLoaded) { FinalAd.Show(); } }; FinalAd.AdListener = intlistener; FinalAd.CustomBuild(); } }
public override void Update(GameTime gameTime, bool otherScreenHasFocus, bool coveredByOtherScreen) { base.Update(gameTime, otherScreenHasFocus, coveredByOtherScreen); timer += gameTime.ElapsedGameTime.Milliseconds; if (timer > 60000) { #if ANDROID //-------------------------------------------------InterstitialAd stuff Android.Gms.Ads.InterstitialAd FinalAd = AdWrapper.ConstructFullPageAdd(Manager.activity, Manager.AdsID); var intlistener = new adlistener(Manager); intlistener.AdLoaded += () => { if (FinalAd.IsLoaded) { FinalAd.Show(); } }; FinalAd.AdListener = intlistener; FinalAd.CustomBuild(); SetTimer(); //------------------------------------------------------------- #endif timer = 0; } }
private void MenuMenu1EntrySelected(object sender, PlayerIndexEventArgs e) { try { #if ANDROID //-------------------------------------------------InterstitialAd stuff Android.Gms.Ads.InterstitialAd FinalAd = AdWrapper.ConstructFullPageAdd(Manager.activity, Manager.AdsID); var intlistener = new adlistener(Manager); intlistener.AdLoaded += () => { if (FinalAd.IsLoaded) { FinalAd.Show(); } }; FinalAd.AdListener = intlistener; FinalAd.CustomBuild(); SetTimer(); //------------------------------------------------------------- #endif } catch (Exception ex) { Console.WriteLine(ex.Message + ex.StackTrace); } }