public static AdRequest GetAdRequest (bool addTestDevice)
        {
            var testDeviceId = "9CCC83D186F2A2DF954788ACE76F5F41";
            var builder = new AdRequest.Builder ();

            if (addTestDevice)
                builder.AddTestDevice (testDeviceId);

            return builder.Build ();
        }
		public AdsInterstitialImplementation(List<string>testDevices = null)
        {
			requestBuilder = new AdRequest.Builder();
			if (testDevices != null)
			{
				foreach (var id in testDevices)
					requestBuilder.AddTestDevice(id);
				requestBuilder.AddTestDevice(AdRequest.DeviceIdEmulator);
			}
        }
        public static AdRequest GetAdRequest (bool addTestDevice)
        {
            var testDeviceId = "BC2508B19A2078B6AC72133BB7E6E177";
            var builder = new AdRequest.Builder ();

            if (addTestDevice)
                builder.AddTestDevice (testDeviceId);

            return builder.Build ();
        }
        public void Show(string adUnit)
        {                        
            var context = Application.Context;
            _ad = new InterstitialAd(context);
            _ad.AdUnitId = adUnit;

            var intlistener = new InterstitialAdListener(_ad);
            intlistener.OnAdLoaded();
            _ad.AdListener = intlistener;

            var requestbuilder = new AdRequest.Builder();
            _ad.LoadAd(requestbuilder.Build());
        }
Esempio n. 5
0
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate (bundle);

            // Create your application here
            SetContentView (Resource.Layout.contactDetailLayout);

            var toolbar = FindViewById<Android.Support.V7.Widget.Toolbar> (Resource.Id.contactDetailToolbar);
            SetSupportActionBar (toolbar);
            SupportActionBar.Title = "Search Result";
            SupportActionBar.SetDisplayHomeAsUpEnabled (true);

            var searchList = FindViewById<ListView> (Resource.Id.listViewContactDetail);

            var madview = FindViewById<AdView>(Resource.Id.mysearchadview);
            AdRequest myrqst = new AdRequest.Builder ().AddTestDevice(AdRequest.DeviceIdEmulator).Build ();
            madview.LoadAd (myrqst);

            searchList.Divider = null;
            searchList.DividerHeight = 0;

            var userstring = handleIntent (Intent);

            userstring = userstring.ToLower ();

            if (userstring != null) {
                var totalrecords = myUtility.getRecordingDatas ();

                var filteredrecords = totalrecords.Where (x => (x.contactName != null && x.contactName.ToLower ().Contains (userstring)) ||
                                      (x.contactNumber != null && x.contactNumber.ToLower ().Contains (userstring)) ||
                                      (x.notes != null && x.notes.ToLower ().Contains (userstring))).ToList ();

                var searchemptytextview = FindViewById<TextView> (Resource.Id.textViewsearchlistempty);

                if (filteredrecords.Count != 0)
                    searchemptytextview.Visibility = ViewStates.Gone;
                else
                    searchemptytextview.Text = "No Records Found Matching the text";

                searchList.Adapter = new myRecodingsAdapter (this, filteredrecords);

                searchList.ItemClick += (object sender, AdapterView.ItemClickEventArgs e) => {
                    var myintnet = new Intent (this, typeof(recordDetailActivity));
                    myintnet.PutExtra ("RecordID", filteredrecords [e.Position].ID);
                    myintnet.PutExtra ("PreviousPage", "RecordList");
                    StartActivity (myintnet);
                };
            }
        }
        protected override void OnElementChanged(ElementChangedEventArgs<Xamarin.Forms.View> e)
        {
            base.OnElementChanged(e);
            if (Control == null)
            {
                var adsbanner = (AdBanner)Element;
                var adview = new AdView(Context);
                adview.AdSize = AdSize.Banner;
                adview.AdUnitId = adsbanner.AdID;
                var requestbuilder = new AdRequest.Builder();
                adview.LoadAd(requestbuilder.Build());
                base.SetNativeControl(adview);
            }

        }
		protected override void OnCreate (Bundle savedInstanceState)
		{
			base.OnCreate (savedInstanceState);
			SetContentView (Resource.Layout.activity_main);

			mAdView = FindViewById<AdView> (Resource.Id.adView);
			var adRequest = new AdRequest.Builder ().Build ();
			mAdView.LoadAd (adRequest);

			mInterstitialAd = new InterstitialAd (this);
			mInterstitialAd.AdUnitId = GetString (Resource.String.test_interstitial_ad_unit_id);

			mInterstitialAd.AdListener = new AdListener (this);

			mLoadInterstitialButton = FindViewById<Button> (Resource.Id.load_interstitial_button);
			mLoadInterstitialButton.SetOnClickListener (new OnClickListener (this));
		}
Esempio n. 8
0
        /// <summary>
        /// reload the view and hit up google admob 
        /// </summary>
        /// <param name="e"></param>
        protected override void OnElementChanged(ElementChangedEventArgs<View> e)
        {
            base.OnElementChanged(e);

            //convert the element to the control we want
            var adMobElement = Element as AdmobBannerView;

            if ((adMobElement != null) && (e.OldElement == null))
            {
                var ad = new AdView(Context);
                ad.AdSize = AdSize.Banner;
                ad.AdUnitId = adMobElement.AdUnitID;
                var requestbuilder = new AdRequest.Builder();
                ad.LoadAd(requestbuilder.Build());
                SetNativeControl(ad);
            }
        }
Esempio n. 9
0
    private void RequestBanner()
    {
#if UNITY_ANDROID
        string adUnitId = "ca-app-pub-3759795642939239/9010454118";
#elif UNITY_IPHONE
        string adUnitId = "ca-app-pub-3940256099942544/2934735716";
#else
        string adUnitId = "unexpected_platform";
#endif
        // Create a 320x50 banner at the top of the screen.
        BannerView bannerView = new BannerView(adUnitId, AdSize.SmartBanner, AdPosition.Bottom);

        // Create an empty ad request.
        AdRequest request = new AdRequest.Builder().Build();

        // Load the banner with the request.
        bannerView.LoadAd(request);
    }
Esempio n. 10
0
    private void RequestInterstitial()
    {
#if UNITY_ANDROID
        string adUnitId = "ca-app-pub-8142240178040183/9288188771";
#elif UNITY_IPHONE
        string adUnitId = "ca-app-pub-8142240178040183/1541560698";
#else
        string adUnitId = "unexpected_platform";
#endif

        // Initialize an InterstitialAd.
        MainScript.self.interstitial = new InterstitialAd(adUnitId);
        // Create an empty ad request.
        AdRequest request = new AdRequest.Builder().AddTestDevice("CAEFBEA8A22A6FF3829FC96E1660EE3F").Build();
        // Load the interstitial with the request.

        MainScript.self.interstitial.LoadAd(request);
    }
Esempio n. 11
0
File: Admob.cs Progetto: Kuyul/Surf
    public void RequestInterstitial()
    {
#if UNITY_ANDROID
        string adUnitId = "ca-app-pub-3529204849708317/1997674232";
#elif UNITY_IPHONE
        string adUnitId = "ca-app-pub-3529204849708317/1317821843";
#else
        string adUnitId = "unexpected_platform";
#endif

        // Initialize an InterstitialAd.
        interstitial = new InterstitialAd(adUnitId);

        // Create an empty ad request.
        AdRequest request = new AdRequest.Builder().Build();
        // Load the interstitial with the request.
        interstitial.LoadAd(request);
    }
Esempio n. 12
0
    private void BannerRequest()
    {
#if UNITY_EDITOR
        string adUnitId = "unused";
#elif UNITY_ANDROID
        string adUnitId = "ca-app-pub-5506973357467780/9763532588";
#elif UNITY_IOS
        string adUnitId = "INSERT_IOS_AD_UNIT_ID";
#else
        string adUnitId = "Unexpected Platform";
#endif
        //banner 320x50 at bottom
        BannerView bannerView = new BannerView(adUnitId, AdSize.Banner, AdPosition.Bottom);
        //AdRequest
        AdRequest request = new AdRequest.Builder().Build();
        //Load Banner
        bannerView.LoadAd(request);
    }
Esempio n. 13
0
    private void RequestRewardedVideo()
    {
                #if UNITY_ANDROID
        string adUnitId = AndroidUnitID;
                #elif UNITY_IPHONE
        string adUnitId = IOSRewardUnitID;
                #else
        string adUnitId = "unexpected_platform";
                #endif

        // Create an empty ad request.
        AdRequest request = new AdRequest.Builder()
                            .AddTestDevice(AdRequest.TestDeviceSimulator)
                            .AddTestDevice(testDevice)
                            .Build();
        // Load the rewarded video ad with the request.
        this.rewardBasedVideo.LoadAd(request, adUnitId);
    }
Esempio n. 14
0
    public void showBannerAd()
    {
        string adID = "ca-app-pub-8510788786917467/5368330230";

        //***For Testing in the Device***

        /*AdRequest request = new AdRequest.Builder()
         * .AddTestDevice(AdRequest.TestDeviceSimulator)       // Simulator.
         * .AddTestDevice("B038F5B1CAFF239E2B88E4EBA10")  // My test device.
         * .Build();*/

        //***For Production When Submit App***
        AdRequest request = new AdRequest.Builder().Build();

        BannerView bannerAd = new BannerView(adID, AdSize.SmartBanner, AdPosition.Bottom);

        bannerAd.LoadAd(request);
    }
Esempio n. 15
0
    public void RequestInterstitial()
    {
        string adUnitId = "ca-app-pub-5719821723126134/9125547377";

        // Initialize an InterstitialAd.

        this._interstitial = new InterstitialAd(adUnitId);

        // Create an empty ad request.

        AdRequest request = new AdRequest.Builder().Build();

        this._interstitial.OnAdClosed += HandleOnAdClosed;

        // Load the interstitial with the request.

        this._interstitial.LoadAd(request);
    }
Esempio n. 16
0
    public void InitAds()
    {
        // Create a 320x50 banner at the top of the screen.
        //bannerViewVar = new BannerView(BannerId, AdSize.SmartBanner, AdPosition.Bottom);
        //requestBanner = new AdRequest.Builder().Build();
        //bannerViewVar.LoadAd(requestBanner);

        // Initialize an InterstitialAd.
        this.interstitial = new InterstitialAd(InterstitialId);

        this.interstitial.OnAdClosed += HandleOnAdClosed;

        // Create an empty ad request.
        AdRequest request = new AdRequest.Builder().Build();

        // Load the interstitial with the request.
        this.interstitial.LoadAd(request);
    }
Esempio n. 17
0
    private void RequestRewardedVideoAd()
    {
        //FOR REAL APP
        string video_ID = "ca-app-pub-4584046040765403/6257877623";

        //FOR TESTING
        //string video_ID = "ca-app-pub-3940256099942544/5224354917";

        this.rewardedAd = new RewardedAd(video_ID);

        //FOR REAL APP
        AdRequest request = new AdRequest.Builder().Build();

        //FOR TESTING
        //AdRequest request = new AdRequest.Builder().AddTestDevice("2077ef9a63d2b398840261c8221a0c9b").Build();

        this.rewardedAd.LoadAd(request);
    }
Esempio n. 18
0
    private void RequestInterstitial()
    {
    #if UNITY_ANDROID
        string adUnitId = id;
    #elif UNITY_IPHONE
        string adUnitId = id;
    #else
        string adUnitId = "unexpected_platform";
    #endif

        // Initialize an InterstitialAd.
        interstitial = new InterstitialAd(adUnitId);

        // Create an empty ad request.
        AdRequest request = new AdRequest.Builder().Build();
        // Load the interstitial with the request.
        interstitial.LoadAd(request);
    }
Esempio n. 19
0
    private void RequestBanner()
    {
#if UNITY_ANDROID
        string adUnitId = "ca-app-pub-8142240178040183/7869623993";
#elif UNITY_IOS
        string adUnitId = "ca-app-pub-8142240178040183/2739790082";
#else
        string adUnitId = "unexpected_platform";
#endif

        //adUnitId = "ca-app-pub-3940256099942544/6300978111"; //test
        // Create a 320x50 banner at the top of the screen.
        bannerView = new BannerView(adUnitId, AdSize.SmartBanner, AdPosition.Bottom);
        // Create an empty ad request
        AdRequest request = new AdRequest.Builder().AddTestDevice("CAEFBEA8A22A6FF3829FC96E1660EE3F").Build();
        // Load the banner with the request.
        bannerView.LoadAd(request);
    }
Esempio n. 20
0
    void RequestBanner()
    {
        string bannerID = "ca-app-pub-9506211863408963/7069029599";

        _bannerAd = new BannerView(bannerID, AdSize.SmartBanner, AdPosition.Bottom);

        //For real app
        AdRequest adRequest = new AdRequest.Builder().Build();

        DisplayBanner();

        //For test
        // AdRequest adRequest = new AdRequest.Builder().AddTestDevice("2077ef9a63d2b398840261c8221a0c9b").Build();

        _bannerAd.LoadAd(adRequest);

        //Show banner for test
    }
Esempio n. 21
0
    private void InitVideo()
    {
        // Get singleton reward based video ad reference.
        this.rewardBasedVideo = RewardBasedVideoAd.Instance;

#if UNITY_ANDROID
        string adUnitId = "ca-app-pub-3940256099942544/5224354917";
#elif UNITY_IPHONE
        string adUnitId = "ca-app-pub-3940256099942544/1712485313";
#else
        string adUnitId = "unexpected_platform";
#endif

        // Create an empty ad request.
        AdRequest request = new AdRequest.Builder().Build();
        // Load the rewarded video ad with the request.
        this.rewardBasedVideo.LoadAd(request, adUnitId);
    }
Esempio n. 22
0
    // загрузка бангера
    private void LoadBanner(string adUnitID)
    {
        // Create  banner .
        if (isSmartBanner)
        {
            bannerView = new BannerView(adUnitID, AdSize.SmartBanner, BanerPosition);
        }
        else
        {
            bannerView = new BannerView(adUnitID, AdSize.Banner, BanerPosition);
        }
        // Create an empty ad request.
        AdRequest request = new AdRequest.Builder().Build();

        // Load the banner with the request.
        bannerView.LoadAd(request);
        AddEventBanner();
    }
Esempio n. 23
0
    void LoadInterstital()
    {
        Music.instance.TurnOn();
        if (_interstital != null)
        {
            _interstital.Destroy();
        }
        this._interstital = new InterstitialAd(InterstitialId);

        this._interstital.OnAdClosed       += InterstitialWatched;
        this._interstital.OnAdOpening      += _interstital_OnAdOpening;
        this._interstital.OnAdFailedToLoad += Interstitial_failedtoLoad;
        this._interstital.OnAdLoaded       += Debug_InterstitialLoaded;

        AdRequest request = new AdRequest.Builder().Build();

        this._interstital.LoadAd(request);
    }
Esempio n. 24
0
        private void LoadAd()
        {
            if (null != interstitial)
            {
                interstitial.Destroy();
            }

            interstitial                         = new GoogleMobileAds.Api.InterstitialAd(ad_unit_id);
            interstitial.OnAdLoaded             += HandleOnAdLoaded;
            interstitial.OnAdFailedToLoad       += HandleOnAdFailedToLoad;
            interstitial.OnAdOpening            += HandleOnAdOpened;
            interstitial.OnAdClosed             += HandleOnAdClosed;
            interstitial.OnAdLeavingApplication += HandleOnAdLeavingApplication;

            AdRequest request = new AdRequest.Builder().Build();

            interstitial.LoadAd(request);
        }
Esempio n. 25
0
    static private void RequestRewardBasedVideo()
    {
        Debug.Log("Rewarded requested");
        // Create an empty ad request.
        AdRequest request;

        if (DataManager.Instance.adsSettings.nonpersonalizedAds)
        {
            Debug.LogWarning("NONPERSONALIZED REWARDED REQUESTED");
            request = new AdRequest.Builder().AddExtra("npa", "1").Build();
        }
        else
        {
            request = new AdRequest.Builder().Build();
        }
        // Load the rewarded video ad with the request.
        rewardBasedVideo.LoadAd(request, adRewardedId);
    }
Esempio n. 26
0
    public void requestInterstital()
    {
        this.interstitial = new InterstitialAd(InterstitialAdID);

        this.interstitial.OnAdLoaded += this.HandleOnAdLoaded;
        // Called when an ad request failed to load.
        this.interstitial.OnAdFailedToLoad += this.HandleOnAdFailedToLoad;
        // Called when an ad is clicked.
        this.interstitial.OnAdOpening += this.HandleOnAdOpened;
        // Called when the user returned from the app after an ad click.
        this.interstitial.OnAdClosed += this.HandleOnAdClosed;
        // Called when the ad click caused the user to leave the application.
        this.interstitial.OnAdLeavingApplication += this.HandleOnAdLeavingApplication;

        AdRequest request = new AdRequest.Builder().Build();

        this.interstitial.LoadAd(request);
    }
Esempio n. 27
0
        public void RequestBanner()
        {
#if UNITY_ANDROID
            const string adUnitId = "ca-app-pub-3940256099942544/6300978111";
#elif UNITY_IPHONE
            const string adUnitId = "ca-app-pub-3940256099942544/2934735716";
#else
            const string adUnitId = "unexpected_platform";
#endif
            // Create a 320x50 banner at the top of the screen.
            //var xPos = (int) (0 + Screen.width * 0.05f);
            //var yPos = (int) (Screen.height - 75 - Screen.height * 0.95f);
            BannerView = new BannerView(adUnitId, AdSize.Banner, AdPosition.TopLeft);
            // Create an empty ad request.
            var request = new AdRequest.Builder().Build();
            // Load the banner with the request.
            BannerView.LoadAd(request);
        }
Esempio n. 28
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);

            // Set our view from the "main" layout resource
            SetContentView(Resource.Layout.Main);
            AdView mAdView   = FindViewById <AdView>(Resource.Id.adView1);
            var    adRequest = new AdRequest.Builder().Build();

            // Start loading the ad.
            mAdView.LoadAd(adRequest);
            var btnstart = FindViewById <Button>(Resource.Id.btnstart);

            btnstart.Click += Btnstart_Click;
            var rate = FindViewById <Button>(Resource.Id.btnrate);

            rate.Click += Rate_Click;
        }
Esempio n. 29
0
    public void OnClickMenu()
    {
        SceneManager.LoadScene(0);
        //Application.LoadLevel(0);
        //isLoaded = true;
        ad = new InterstitialAd(gameover);
        AdRequest request = new AdRequest.Builder().Build();

        ad.LoadAd(request);
        ad.OnAdLoaded += onAdLoad;
        //PlayerPrefs.DeleteAll();
        ////PlayerPrefs.DeleteKey("1");
        //PlayerPrefs.Save();
        //Application.LoadLevel(0);

        //bannerView.Hide();
        //bannerView2.Hide();
    }
Esempio n. 30
0
    private void RequestBanner()
    {
        string adUnitId = "ca-app-pub-3940256099942544/6300978111";

        //adUnitId to use for testing = "ca-app-pub-3940256099942544/6300978111"
        // Create a 320x50 banner at the top of the screen.
        bannerView = new BannerView(adUnitId, AdSize.Banner, AdPosition.Bottom);

        // Create an empty ad request.
        AdRequest request = new AdRequest.Builder().Build();

        //.AddTestDevice(AdRequest.TestDeviceSimulator)
        // .AddTestDevice(SystemInfo.deviceUniqueIdentifier)
        // .Build();// REMOVE ADDTESTDEVICE() AFTER TESTING
        // Debug.Log(request.TestDevices);
        // Load the banner with the request.
        bannerView.LoadAd(request);
    }
Esempio n. 31
0
    private void RequestInterstitial()
    {
 #if UNITY_ANDROID
        string adUnitId = "ca-app-pub-3940256099942544/1033173712";
 #elif UNITY_IPHONE
        string adUnitId = "ca-app-pub-3940256099942544/4411468910";
 #else
        string adUnitId = "unexpected_platform";
 #endif

        // Initialize an InterstitialAd.
        this.interstitial = new InterstitialAd(adUnitId);

        // Create an empty ad request.
        AdRequest request = new AdRequest.Builder().Build();
        // Load the interstitial with the request.
        this.interstitial.LoadAd(request);
    }
Esempio n. 32
0
    private void RequestInterstitial()
    {
                #if UNITY_ANDROID
        string adUnitId = "ca-app-pub-0081066185741622/3658507823";
                #elif UNITY_IPHONE
        string adUnitId = "ca-app-pub-0081066185741622/7331402792";
                #else
        string adUnitId = "unexpected_platform";
                #endif

        // Initialize an InterstitialAd.
        interstitial = new InterstitialAd(adUnitId);

        // Create an empty ad request.
        AdRequest request = new AdRequest.Builder().AddTestDevice("f76690eb0615cccc73b4c57165f1621e").Build();
        // Load the interstitial with the request.
        interstitial.LoadAd(request);
    }
Esempio n. 33
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);


            SetContentView(Resource.Layout.table);

            var id = "ca-app-pub-5385963311823976~5875287959";

            Android.Gms.Ads.MobileAds.Initialize(ApplicationContext, id);
            var adView    = FindViewById <AdView>(Resource.Id.adViewT);
            var adRequest = new AdRequest.Builder().Build();

            adView.LoadAd(adRequest);

            ListView tableListView = FindViewById <ListView>(Resource.Id.tableList);

            tournamentID   = Intent.GetStringExtra("tournamentID");
            tournamentName = Intent.GetStringExtra("tournamentName");

            this.Title = tournamentName + " " + "standings";

            List <points> getPlayersOnThisTournament = con.db.Query <points>("SELECT * FROM points WHERE tournamentID = '" + tournamentID + "' ORDER BY numOfPoints DESC, goalDiference DESC, awayGoals DESC ");

            tableListView.ItemClick += delegate(object sender, Android.Widget.AdapterView.ItemClickEventArgs e)
            {
                string playerName = getPlayersOnThisTournament[e.Position].playerName;

                Intent intent = new Intent(this, typeof(stats));
                intent.PutExtra("tournamentID", tournamentID);
                intent.PutExtra("playerName", playerName);
                intent.PutExtra("tournamentName", tournamentName);
                StartActivity(intent);
            };

            try
            {
                MyListViewAdapter adapter = new MyListViewAdapter(this, getPlayersOnThisTournament);
                tableListView.Adapter = adapter;
            }
            catch (Exception)
            {
            }
        }
Esempio n. 34
0
    private void RequestInterstitial()
    {
        if (this.interstitial != null)
        {
            this.interstitial.Destroy();
        }

        //// Test ortami
        //#if UNITY_ANDROID
        //        string adUnitId = "ca-app-pub-3940256099942544/1033173712";
        //#elif UNITY_IPHONE
        //		string adUnitId = "ca-app-pub-3940256099942544/4411468910";
        //#else
        //        string adUnitId = "unexpected_platform";
        //#endif

        //PROD ortami
#if UNITY_ANDROID
        string adUnitId = "ca-app-pub-7610769761173728/6403378295";
#elif UNITY_IPHONE
        string adUnitId = "ca-app-pub-7610769761173728/2112779498";
#else
        string adUnitId = "unexpected_platform";
#endif

        // Initialize an InterstitialAd.
        this.interstitial = new InterstitialAd(adUnitId);

        // Called when an ad request has successfully loaded.
        this.interstitial.OnAdLoaded += HandleOnAdLoaded;
        // Called when an ad request failed to load.
        this.interstitial.OnAdFailedToLoad += HandleOnAdFailedToLoad;
        // Called when an ad is shown.
        this.interstitial.OnAdOpening += HandleOnAdOpened;
        // Called when the ad is closed.
        this.interstitial.OnAdClosed += HandleOnAdClosed;
        // Called when the ad click caused the user to leave the application.
        this.interstitial.OnAdLeavingApplication += HandleOnAdLeavingApplication;

        // Create an empty ad request.
        AdRequest request = new AdRequest.Builder().Build();
        // Load the interstitial with the request.
        this.interstitial.LoadAd(request);
    }
Esempio n. 35
0
        protected override void OnElementChanged(ElementChangedEventArgs <View> e)
        {
            base.OnElementChanged(e);
            if (e.OldElement == null)
            {
                var adView = new AdView(Context);
                switch ((Element as AdBanner).Size)
                {
                case AdBanner.Sizes.Standardbanner:
                    adView.AdSize = AdSize.Banner;
                    break;

                case AdBanner.Sizes.LargeBanner:
                    adView.AdSize = AdSize.LargeBanner;
                    break;

                case AdBanner.Sizes.MediumRectangle:
                    adView.AdSize = AdSize.MediumRectangle;
                    break;

                case AdBanner.Sizes.FullBanner:
                    adView.AdSize = AdSize.FullBanner;
                    break;

                case AdBanner.Sizes.Leaderboard:
                    adView.AdSize = AdSize.Leaderboard;
                    break;

                case AdBanner.Sizes.SmartBannerPortrait:
                    adView.AdSize = AdSize.SmartBanner;
                    break;

                default:
                    adView.AdSize = AdSize.Banner;
                    break;
                }

                adView.AdUnitId = "ca-app-pub-4681470946279796/6911276953";

                var requestbuilder = new AdRequest.Builder();
                adView.LoadAd(requestbuilder.Build());
                SetNativeControl(adView);
            }
        }
Esempio n. 36
0
    void OnTriggerEnter2D(Collider2D collider)
    {
        if (scriptEnabled)
        {
            // PlayerPrefs.SetInt("relese", 0);
            if (collider.name == "Trunk")
            {
                // PlayerPrefs.SetInt("relese", 1);   // Stop knife moving, rotate with Trunk and play hit sound
                moving           = false;
                transform.parent = collider.transform;
                GetComponent <PolygonCollider2D>().enabled = false;
                knifeRigid.bodyType = RigidbodyType2D.Kinematic;
                transform.GetChild(0).GetComponent <PolygonCollider2D>().enabled = true;
                GetComponent <AudioSource>().PlayOneShot(hitSound);
                spawn.GetComponent <SpawnController>().CreateKnife();
                collider.GetComponent <Animator>().SetTrigger("Hit");
                collider.GetComponent <TrunkHealth>().Damage(1);

                Instantiate(particle, transform.position + transform.up * 0.25f, Quaternion.identity);

                GameController.SetScore(10);
            }
            else
            {
                PlayerPrefs.SetInt("relese", 1);
                // If hit to another knives
                moving = false;
                knifeRigid.bodyType = RigidbodyType2D.Dynamic;
                GetComponent <AudioSource>().PlayOneShot(fail);
                GameObject.Find("TextMessage").GetComponent <Text>().text = "GAME OVER";
                GameController.SaveHighScore();
                GameController.ResetScore();

                StartCoroutine(GoToLevel1());
                ad = new InterstitialAd(gameover);
                AdRequest request = new AdRequest.Builder().Build();
                ad.LoadAd(request);
                ad.OnAdLoaded += onAdLoad;
            }

            scriptEnabled = false;
            GetComponent <Knife>().enabled = false;
        }
    }
Esempio n. 37
0
    private void showBannerAd()
    {
        string adID = "ca-app-pub-9673195993619656/4916067372";

        //***For Testing in the Device***

        /*AdRequest request = new AdRequest.Builder()
         * .AddTestDevice(AdRequest.TestDeviceSimulator)       // Simulator.
         * .AddTestDevice("2077ef9a63d2b398840261c8221a0c9b")  // My test device.
         * .Build();*/

        //***For Production When Submit App***
        AdRequest request = new AdRequest.Builder().Build();

        BannerView bannerAd = new BannerView(adID, AdSize.Banner, AdPosition.Top);

        bannerAd.LoadAd(request);
        Debug.Log("Showing Banner Ad");
    }
Esempio n. 38
0
    private void RequestBanner()

    {
#if UNITY_ANDROID
        string AdUnitID = "ca-app-pub-9141553685549733/5724312975";
#else
        string AdUnitID = "unDefind";
#endif

        BannerView banner = new BannerView(AdUnitID, AdSize.Banner, AdPosition.Bottom);



        AdRequest request = new AdRequest.Builder().Build();

        banner.LoadAd(request);

        isAdsBannerSet = true;
    }
		protected async override void OnCreate (Bundle bundle)
		{
			RequestWindowFeature(WindowFeatures.NoTitle);
			base.OnCreate (bundle);

			Window.AddFlags(WindowManagerFlags.Fullscreen);
			Window.ClearFlags(WindowManagerFlags.ForceNotFullscreen);

			SetContentView (Resource.Layout.VideoViewer);

			videoView = FindViewById<VideoView>(Resource.Id.videoViewer);
			videoView.Touch += videoView_Touch;
			videoView.Prepared += VideoView_Prepared;

			m_videoPregressTimer = new System.Timers.Timer ();
			m_videoPregressTimer.Interval = 500;
			m_videoPregressTimer.Elapsed += T_Elapsed;

			// advertising setup
			AdView mAdView = (AdView) this.FindViewById(Resource.Id.adView);
			AdRequest adRequest = new AdRequest.Builder ().Build ();
			mAdView.LoadAd(adRequest);

			string videoID = Intent.Extras.GetString ("videoID");
			try
			{
				YouTubeUri theURI = await  YouTube.GetVideoUriAsync(videoID,YouTubeQuality.Quality720P);
				var uri = Android.Net.Uri.Parse(theURI.Uri.AbsoluteUri);
				videoView.SetVideoURI(uri);
				videoView.Start ();
				m_videoPregressTimer.Enabled = true;
				m_videoPregressTimer.Start();
				m_videoSourceSet = true;
			}
			catch (Exception ex) 
			{
				Console.WriteLine (ex.ToString ());
			}
		}
Esempio n. 40
0
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate (bundle);

            // Create your application here
            SetContentView(Resource.Layout.contactHistoryLayout);

            var toolbar = FindViewById<Android.Support.V7.Widget.Toolbar> (Resource.Id.contactHistoryToolbar);
            SetSupportActionBar (toolbar);
            SupportActionBar.SetDisplayHomeAsUpEnabled (true);

            var numbertocheck = Intent.Extras.GetString ("FilteredNumber");

            var madview = FindViewById<AdView>(Resource.Id.mycontactHistoryadview);
            AdRequest myrqst = new AdRequest.Builder ().AddTestDevice(AdRequest.DeviceIdEmulator).Build ();
            madview.LoadAd (myrqst);

            var contactHistoryList = FindViewById<ListView> (Resource.Id.contactHistorylist);
            contactHistoryList.Divider = null;
            contactHistoryList.DividerHeight = 0;

            contactHistoryData = myUtility.getRecordingDatas ();

            contactHistoryData = contactHistoryData.Where (x => x.filteredContactNumber == numbertocheck).ToList ();

            contactHistoryList.Adapter = new myRecodingsAdapter (this, contactHistoryData);

            var m = contactHistoryData.First().contactName.ToString();
            SupportActionBar.Title = m + "   (" + contactHistoryData.Count ().ToString () + ")";
            SupportActionBar.Subtitle = contactHistoryData.First().contactNumber.ToString();

            contactHistoryList.ItemClick += (object sender, AdapterView.ItemClickEventArgs e) =>  {
                var myintnet = new Intent (this, typeof(recordDetailActivity));
                myintnet.PutExtra("RecordID", contactHistoryData[e.Position].ID);
                myintnet.PutExtra("PreviousPage", "ContactHistory");
                StartActivity (myintnet);
            };
        }
Esempio n. 41
0
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate (bundle);

            // Create your application here
            SetContentView(Resource.Layout.settingsLayout);

            var toolbar = FindViewById<Android.Support.V7.Widget.Toolbar> (Resource.Id.settingsToolbar);
            SetSupportActionBar (toolbar);
            SupportActionBar.Title = "Settings";
            SupportActionBar.SetDisplayHomeAsUpEnabled (true);

            var madview = FindViewById<AdView>(Resource.Id.mysettingadview);
            AdRequest myrqst = new AdRequest.Builder ().AddTestDevice(AdRequest.DeviceIdEmulator).Build ();
            madview.LoadAd (myrqst);

            prefs = Application.Context.GetSharedPreferences ("WingsRecorder", FileCreationMode.Private);

            //			var formattypes = new String[]{ "MP3", "3GP", "AMR" };
            var fileFormatTextview = FindViewById<TextView> (Resource.Id.textViewFileFormat);
            fileFormatTextview.Text = prefs.GetString("FileType", MainActivity.formattypes[0]);
            var fileformatLinLay = FindViewById<LinearLayout> (Resource.Id.linearLayoutFileFormat);
            fileformatLinLay.Click += delegate {
                var builder = new Android.Support.V7.App.AlertDialog.Builder (this);
                builder.SetTitle ("Select File Format")
                    .SetItems(MainActivity.formattypes,
                        new EventHandler<DialogClickEventArgs>(delegate(object sender, DialogClickEventArgs e) {
                            var prefedit = prefs.Edit ();
                            fileFormatTextview.Text = MainActivity.formattypes[e.Which];
                            prefedit.PutString ("FileType", MainActivity.formattypes[e.Which]);
                            prefedit.Commit();
                        }))
                    .SetNegativeButton("Cancel", delegate {
                    });
                builder.Create().Show ();
            };

            //			var audioSourceTypes = new String[]{"Camcorder", "Mic", "Voice Call",
            //				"Voice Communication", "Voice Recognition", "Voice UpLink", "Voice DownLink"};
            var audioSouceTextview = FindViewById<TextView> (Resource.Id.textViewAudioSource);
            audioSouceTextview.Text = prefs.GetString("AudioSource", MainActivity.audioSourceTypes[2]);
            var audiosourceLinLay = FindViewById<LinearLayout> (Resource.Id.linearLayoutAudioSource);
            audiosourceLinLay.Click += delegate {
                var builder = new Android.Support.V7.App.AlertDialog.Builder (this);
                builder.SetTitle ("Select Audio Source")
                    .SetItems (MainActivity.audioSourceTypes,
                        new EventHandler<DialogClickEventArgs>(delegate(object sender, DialogClickEventArgs e) {
                            var prefedit = prefs.Edit ();
                            audioSouceTextview.Text = MainActivity.audioSourceTypes[e.Which];
                            prefedit.PutString ("AudioSource", MainActivity.audioSourceTypes[e.Which]);
                            prefedit.Commit();
                        }))
                    .SetNegativeButton("Cancel", delegate {
                    });
                builder.Create().Show ();
            };

            //			var currentpath = "/storage/emulated/0/";
            //			var f = new File(currentpath).ListFiles();
            //			var files = f.Where(x=>x.IsDirectory).ToList();
            //
            var storagePathLinLay = FindViewById<LinearLayout> (Resource.Id.linearLayoutStorageLocation);
            storagePathLinLay.Click += delegate {
                StartActivity (new Intent (this, typeof(pathChooseActivity)));
            };
        }
		protected override async void OnCreate (Bundle bundle)
		{
			base.OnCreate (bundle);
			SetContentView (Resource.Layout.Main);
			this.ActionBar.NavigationMode = ActionBarNavigationMode.Tabs;



			// prevent screen lock; require WAKE_LOCK permission in the manifest
			this.Window.SetFlags(WindowManagerFlags.KeepScreenOn, WindowManagerFlags.KeepScreenOn);

			// retrieve the playlist from azure
			WebClient httpclient = new WebClient (); 
			string theFileList = "";
			try{
				theFileList = httpclient.DownloadString (m_playlist);
				theFileList = theFileList.Replace ("\r\n", "^");
			}
			catch(Exception ex) {
				System.Console.WriteLine (ex.ToString ());
			}
			string[] VideoList = theFileList.Split (new char[] { '^'});
			List<string> myData = new List<string> ();
			foreach (string s in VideoList) {
				if (s.StartsWith("#")) continue;
				string[] elements = s.Split (new char[]{ ';' });
				if (elements.Length < 4)
					continue;

				videoItem tempItem = new videoItem (){Page = elements[0], Title = elements [1], URL = elements [2], ImageURL = elements [3] };
				//tempItem.Image = await GetImageFromUrl(tempItem.ImageURL);
				m_theVideos.Add (tempItem);
				myData.Add (m_theVideos[m_theVideos.Count-1].Title);
			}


			// parellel download of all the miniatures
			var downloadTasksQuery = new Task<Bitmap>[m_theVideos.Count];
			for (int i = 0; i < m_theVideos.Count; i++) {
				downloadTasksQuery [i] = GetImageFromUrl (m_theVideos [i].ImageURL);
			}				
			Bitmap[] myImages = await Task.WhenAll (downloadTasksQuery);
			for (int i = 0; i < m_theVideos.Count; i++) {
				m_theVideos [i].Image = myImages [i];
			}
				


			AddTab ("Fiabe", 1, Resource.Drawable.favolesenzatempo,  new TabContentFragment(1) );
			AddTab ("Zecchino", 2, Resource.Drawable.favolesenzatempo,  new TabContentFragment(2) );
			AddTab ("Canzoncine", 3, Resource.Drawable.favolesenzatempo,  new TabContentFragment(3) );
			AddTab ("NinnaNanna", 4, Resource.Drawable.favolesenzatempo,  new TabContentFragment(4) );






			// advertising setup
			AdView mAdView = (AdView) this.FindViewById(Resource.Id.adView);
			AdRequest adRequest = new AdRequest.Builder ().Build ();
			mAdView.LoadAd(adRequest);
		}
Esempio n. 43
0
		protected void RequestNewInterstitial ()
		{
			var adRequest = new AdRequest.Builder ().Build ();
			mInterstitialAd.LoadAd (adRequest);
		}
		public static InterstitialAd CustomBuild(this InterstitialAd ad)
		{
			var requestbuilder = new AdRequest.Builder();
			ad.LoadAd(requestbuilder.Build());
			return ad;
		}
		public static AdView CustomBuild(this AdView ad)
		{
			var requestbuilder = new AdRequest.Builder();
			ad.LoadAd(requestbuilder.Build());
			return ad;
		}