Example #1
0
        public App()
        {
            InitializeComponent();

            SubscribeToDisplayAlertMessages();

            // The navigation logic startup needs to diverge per platform in order to meet the UX design requirements
            if (Device.OS == TargetPlatform.Android)
            {
                // if this is an Android device, set the MainPage to a new SplashPage
                MainPage = new SplashPage();
            }
            else
            {
                // create a new NavigationPage, with a new AcquaintanceListPage set as the Root
                var navPage =
                    new NavigationPage(
                        new AcquaintanceListPage()
                {
                    BindingContext = new AcquaintanceListViewModel(),
                    Title          = "Acquaintances"
                })
                {
                    BarBackgroundColor = Color.FromHex("547799")
                };

                navPage.BarTextColor = Color.White;

                // set the MainPage of the app to the navPage
                MainPage = navPage;
            }
        }
Example #2
0
        public App()
        {
            InitializeComponent();

            SubscribeToDisplayAlertMessages();

            if (Device.OS == TargetPlatform.Android)
            {
                MainPage = new SplashPage();
            }
            else
            {
                var navPage =
                    new NavigationPage(
                        new AcquaintanceListPage()
                {
                    BindingContext = new AcquaintanceListViewModel(),
                    Title          = "Acquaintances"
                })
                {
                    BarBackgroundColor = Color.FromHex("547799"),
                    BarTextColor       = Color.White
                };

                MainPage = navPage;
            }
        }
Example #3
0
        public App()
        {
            InitializeComponent();

            SubscribeToDisplayAlertMessages();

            if (Device.OS == TargetPlatform.Android)
            {
                MainPage = new SplashPage();
            }
            else
            {
                var navPage =
                    new NavigationPage(
                        new AcquaintanceListPage()
                        {
                            BindingContext = new AcquaintanceListViewModel(),
                            Title="Acquaintances" })
                {
                    BarBackgroundColor = Color.FromHex("547799"),
                    BarTextColor = Color.White
                };

                MainPage = navPage;
            }
        }
Example #4
0
        protected async override void OnResume()
        {
            base.OnResume();

            //Workaround for <5.0 devices: https://bugzilla.xamarin.com/show_bug.cgi?id=36907
            if (Device.OS == TargetPlatform.Android)
            {
                await Task.Delay(10);

                // if this is an Android device, set the MainPage to a new SplashPage
                MainPage = new SplashPage();
            }
        }
Example #5
0
        public App()
        {
            InitializeComponent();

            SubscribeToDisplayAlertMessages();

            // The navigation logic startup needs to diverge per platform in order to meet the UX design requirements
            if (Xamarin.Forms.Device.OS == TargetPlatform.Android)
            {
                // if this is an Android device, set the MainPage to a new SplashPage
                MainPage = new SplashPage();
            }
            else
            {
                // create a new NavigationPage, with a new AcquaintanceListPage set as the Root
                var navPage =
                    new NavigationPage(
                        new AcquaintanceListPage()
                {
                    BindingContext = new AcquaintanceListViewModel(),
                    Title          = "Acquaintances"
                })
                {
                    BarBackgroundColor = Color.FromHex("547799")
                };

                navPage.BarTextColor = Color.White;

                // set the MainPage of the app to the navPage
                MainPage = navPage;
            }

            AppCenter.LogLevel = LogLevel.Verbose;
            AppCenter.Start("android=e2a89d4b-929c-4936-9b70-e33ace1ac02c;uwp=34d5ed40-4ff1-4db4-9ef6-0eefbf97e8ab;ios=7056d0a8-3a01-49e4-8fca-f5eff47839df", typeof(Analytics), typeof(Auth), typeof(Crashes), typeof(AcData.Data));
            Analytics.TrackEvent("StartCalled", new System.Collections.Generic.Dictionary <string, string> {
                { "StartTime", System.DateTime.Now.ToString("HH:MM") }
            });
        }
        public App()
        {
            InitializeComponent();

            SubscribeToDisplayAlertMessages();

            // The navigation logic startup needs to diverge per platform in order to meet the UX design requirements
            if (Xamarin.Forms.Device.OS == TargetPlatform.Android)
            {
                // if this is an Android device, set the MainPage to a new SplashPage
                MainPage = new SplashPage();
            }
            else
            {
                // create a new NavigationPage, with a new AcquaintanceListPage set as the Root
                var navPage =
                    new NavigationPage(
                        new AcquaintanceListPage()
                {
                    BindingContext = new AcquaintanceListViewModel(),
                    Title          = "Acquaintances"
                })
                {
                    BarBackgroundColor = Color.FromHex("547799")
                };

                navPage.BarTextColor = Color.White;

                // set the MainPage of the app to the navPage
                MainPage = navPage;
            }
            AppCenter.LogLevel = LogLevel.Verbose;
            AppCenter.Start("android=34d5ed40-4ff1-4db4-9ef6-0eefbf97e8ab;uwp=34d5ed40-4ff1-4db4-9ef6-0eefbf97e8ab;ios=7056d0a8-3a01-49e4-8fca-f5eff47839df", typeof(Analytics), typeof(Crashes));


            var handle = LoadPackagedLibrary("kernel32.dll");

            if (handle == IntPtr.Zero)
            {
                Analytics.TrackEvent("Pointer is zero");
                // throw new MobileCenterException(ErrorMessage);
            }
            Analytics.TrackEvent("handlefound");
            try
            {
                var address = GetProcAddress(handle, "WerRegisterCustomMetadata");
                Analytics.TrackEvent("GetProc");
                if (address == IntPtr.Zero)
                {
                    Analytics.TrackEvent("GetProcIszero");
                    // throw new MobileCenterException(ErrorMessage);
                }
                var registrationMethod = Marshal.GetDelegateForFunctionPointer(address, typeof(RegisterCustomMetadataDelegate));
                if (registrationMethod == null)
                {
                    Analytics.TrackEvent("MethodIsNull");
                    // throw new MobileCenterException(ErrorMessage);
                }
                registrationMethod.DynamicInvoke(WatsonKey, "34d5ed40-4ff1-4db4-9ef6-0eefbf97e8ab");
                Analytics.TrackEvent("CrashMetadataSet");
            }
            catch (Exception e)
            {
                Analytics.TrackEvent("crashInit:" + e.Message.ToString());
            }
            finally
            {
                FreeLibrary(handle);
            }

            //try
            //{
            //  //  WerRegisterCustomMetadata("VSMCAppSecret", "34d5ed40-4ff1-4db4-9ef6-0eefbf97e8ab");

            //    Analytics.TrackEvent("CrashMetadataSet");
            //}
            //catch (System.Exception e)
            //{
            //    Analytics.TrackEvent("crashInit:" + e.Message.ToString());
            //}
            Analytics.TrackEvent("CrashEnabled:" + Crashes.IsEnabledAsync().Result);
        }