protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);

            _game = new Game1();
            SetContentView((View)_game.Services.GetService(typeof(View)));

            _ouyaInputView = new OuyaInputView(this);

            _game.Run();
        }
Esempio n. 2
0
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);

            _game = new Game1();
            SetContentView((View)_game.Services.GetService(typeof(View)));

            _ouyaInputView = new OuyaInputView(this);

			_game.Run();
        }
Esempio n. 3
0
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);

#if MONOGAME_4_4
            _game = new Game1();
            SetContentView((View)_game.Services.GetService(typeof(View)));

#else
            Game1.Activity = this;
			_game = new Game1();
			SetContentView(_game.Window);
#endif

            _ouyaInputView = new OuyaInputView(this);

			_game.Run();
        }
Esempio n. 4
0
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);
            Game1.Activity = this;
            _game = new Game1();
            SetContentView(_game.Window);

			using (var ignore = new OuyaInputView (this)) {
				// do nothing
			}

			View content = FindViewById (Android.Resource.Id.Content);
			if (null != content) {
				content.KeepScreenOn = true;
			}

            _game.Run();
        }
Esempio n. 5
0
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);
            Game1.Activity = this;
            _game          = new Game1();
            SetContentView(_game.Window);

            using (var ignore = new OuyaInputView(this)) {
                // do nothing
            }

            View content = FindViewById(Android.Resource.Id.Content);

            if (null != content)
            {
                content.KeepScreenOn = true;
            }

            _game.Run();
        }
Esempio n. 6
0
        protected override void OnCreate(Bundle bundle)
        {
			sInstance = this;

            base.OnCreate(bundle);

#if MONOGAME_4_4
            _game = new Game1();
            SetContentView((View)_game.Services.GetService(typeof(View)));

#else
            Game1.Activity = this;
			_game = new Game1();
			SetContentView(_game.Window);
#endif

			_ouyaInputView = new TV.Ouya.Sdk.OuyaInputView (this);

			View content = FindViewById (Android.Resource.Id.Content);
			if (null != content) {
				content.KeepScreenOn = true;
			}
            _game.Run();

			Bundle developerInfo = new Bundle();

            developerInfo.PutString(OuyaFacade.OUYA_DEVELOPER_ID, DEVELOPER_ID);

			byte[] applicationKey = null;

			// load the application key from assets
			try {
				AssetManager assetManager = ApplicationContext.Assets;
				AssetFileDescriptor afd = assetManager.OpenFd(SIGNING_KEY);
				int size = 0;
				if (null != afd) {
					size = (int)afd.Length;
					afd.Close();
					using (Stream inputStream = assetManager.Open(SIGNING_KEY, Access.Buffer))
					{
						applicationKey = new byte[size];
						inputStream.Read(applicationKey, 0, size);
						inputStream.Close();
					}
				}
			} catch (Exception e) {
				Log.Error (TAG, string.Format("Failed to read application key exception={0}", e));
			}

			if (null != applicationKey) {
				Log.Debug (TAG, "Read signing key");
				developerInfo.PutByteArray (OuyaFacade.OUYA_DEVELOPER_PUBLIC_KEY, applicationKey);
			} else {
				Log.Error (TAG, "Failed to authorize with signing key");
				Finish ();
				return;
			}

			//developerInfo.PutString(OuyaFacade.XIAOMI_APPLICATION_ID, "0000000000000");
			//developerInfo.PutString(OuyaFacade.XIAOMI_APPLICATION_KEY, "000000000000000000");

			//developerInfo.PutStringArray(OuyaFacade.OUYA_PRODUCT_ID_LIST, Game1.PURCHASABLES);

			_ouyaFacade = OuyaFacade.Instance;
			_ouyaFacade.Init(this, developerInfo);
        }
Esempio n. 7
0
        protected override void OnCreate(Bundle bundle)
        {
            sInstance = this;

            base.OnCreate(bundle);

#if MONOGAME_3_4 || MONOGAME_3_5
            _game = new Game1();
            SetContentView((View)_game.Services.GetService(typeof(View)));
#else
            Game1.Activity = this;
            _game          = new Game1();
            SetContentView(_game.Window);
#endif

            _ouyaInputView = new TV.Ouya.Sdk.OuyaInputView(this);

            View content = FindViewById(Android.Resource.Id.Content);
            if (null != content)
            {
                content.KeepScreenOn = true;
            }
            _game.Run();

            Bundle developerInfo = new Bundle();

            developerInfo.PutString(OuyaFacade.OUYA_DEVELOPER_ID, DEVELOPER_ID);

            byte[] applicationKey = null;

            // load the application key from assets
            try {
                AssetManager        assetManager = ApplicationContext.Assets;
                AssetFileDescriptor afd          = assetManager.OpenFd(SIGNING_KEY);
                int size = 0;
                if (null != afd)
                {
                    size = (int)afd.Length;
                    afd.Close();
                    using (Stream inputStream = assetManager.Open(SIGNING_KEY, Access.Buffer))
                    {
                        applicationKey = new byte[size];
                        inputStream.Read(applicationKey, 0, size);
                        inputStream.Close();
                    }
                }
            } catch (Exception e) {
                Log.Error(TAG, string.Format("Failed to read application key exception={0}", e));
            }

            if (null != applicationKey)
            {
                Log.Debug(TAG, "Read signing key");
                developerInfo.PutByteArray(OuyaFacade.OUYA_DEVELOPER_PUBLIC_KEY, applicationKey);
            }
            else
            {
                Log.Error(TAG, "Failed to authorize with signing key");
                Finish();
                return;
            }

            //developerInfo.PutString(OuyaFacade.XIAOMI_APPLICATION_ID, "0000000000000");
            //developerInfo.PutString(OuyaFacade.XIAOMI_APPLICATION_KEY, "000000000000000000");

            //developerInfo.PutStringArray(OuyaFacade.OUYA_PRODUCT_ID_LIST, Game1.PURCHASABLES);

            _ouyaFacade = OuyaFacade.Instance;
            _ouyaFacade.Init(this, developerInfo);
        }