Example #1
0
 public static GAService GetGASInstance()
 {
     if (thisRef == null)
     {
         // it's ok, we can call this constructor
         thisRef = new GAService();
     }
     return(thisRef);
 }
Example #2
0
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);

            GAService.GetGASInstance().Initialize_NativeGAS(this);

            AppDomain.CurrentDomain.UnhandledException += (s, e) =>
            {
                Exception ee   = (Exception)e.ExceptionObject;
                string    ip   = "";
                string    name = "";
                try { name = ContributerName; } catch { }
                try { ip = GetIP(); } catch { }
                bool t1;
                bool t2;
                ADFGXService.SetLog("EXCEPTION", ee.Message, ee.InnerException + System.Environment.NewLine + System.Environment.NewLine + ee.StackTrace, "ANDROID", ip, name, out t1, out t2);
                ShowAlert("A fatal error occured. Info sent to server, we will fix this ASAP!" + ee.Message);
            };

            AndroidEnvironment.UnhandledExceptionRaiser += (s, e) =>
            {
                string ip   = "";
                string name = "";
                try { name = ContributerName; } catch { }
                try { ip = GetIP(); } catch { }
                bool t1;
                bool t2;
                ADFGXService.SetLog("EXCEPTION", e.Exception.Message, e.Exception.InnerException + System.Environment.NewLine + System.Environment.NewLine + e.Exception.StackTrace, "ANDROID", ip, name, out t1, out t2);
                ShowAlert("A fatal error occured. Info sent to server, we will fix this ASAP!" + e.Exception.Message);
            };

            this.Title = "ADFGX Cloud Solver";
            // Set our view from the "main" layout resource
            SetContentView(Resource.Layout.Main);
            //Init our Update UI Timer
            UpdateUITimer.Interval = 5000;
            UpdateUITimer.Elapsed += UpdateUIEvent;
            //Set Button Event
            Button startbutton = FindViewById <Button>(Resource.Id.StartButton);

            startbutton.Click += delegate { BruteForceEvent(startbutton); };
            Button topscoresbutton = FindViewById <Button>(Resource.Id.TopScoresButton);

            topscoresbutton.Click += delegate { TopScoresEvent(); };
            Button newsbutton = FindViewById <Button>(Resource.Id.NewsButton);

            newsbutton.Click += delegate { NewsEvent(); };
            ProgressBar Pbar = FindViewById <ProgressBar>(Resource.Id.Pbar);

            Pbar.Visibility = ViewStates.Invisible;
        }