using Microsoft.Xna.Framework; using Android.App; using Android.Content.PM; using Android.OS; using Android.Views; using Engine.Integration.MonoGame; using Engine.Core; using Engine.Core.Debug; namespace MyUniverse.Platforms.Android { [Activity( Label = "@string/app_name", MainLauncher = true, Icon = "@drawable/icon", AlwaysRetainTaskState = true, LaunchMode = LaunchMode.SingleInstance, ScreenOrientation = ScreenOrientation.Portrait, ConfigurationChanges = ConfigChanges.Orientation | ConfigChanges.Keyboard | ConfigChanges.KeyboardHidden | ConfigChanges.ScreenSize )] public class Program : AndroidGameActivity { private MonoGameWindow _game; private View _view; protected override void OnCreate(Bundle bundle) { base.OnCreate(bundle); Universe universe = new(); ILogger logger = new RotatingFileLogger("Logs", "MyGame"); universe.InstantiateUniverseObject().SetUniverseObject("Logger") .BehaviourController.AddBehaviour().Logger = ILogger.Shared = logger; universe.InstantiateUniverseObject().SetUniverseObject("Desktop Inputs") .BehaviourController.AddBehaviour(); universe.InstantiateUniverseObject().SetUniverseObject("Visual Managers") .BehaviourController.AddBehaviour() .BehaviourController.AddBehaviour(); /* For Networking LiteNetLibClient client = universe.InstantiateUniverseObject().SetUniverseObject("Client").BehaviourController.AddBehaviour(); client.BehaviourController.AddBehaviour(); universe.OnPreUpdate.AddOneTimeListener((_, _) => client.Connect("localhost", 8888)); */ Shared.UniverseSource.ApplyUniverse(universe); _game = new MonoGameWindow(universe); _view = _game.Services.GetService(typeof(View)) as View; SetContentView(_view); _game.Run(); } } }