Ejemplo n.º 1
0
        //
        // This method is invoked when the application has loaded and is ready to run. In this
        // method you should instantiate the window, load the UI into it and then make the window
        // visible.
        //
        // You have 17 seconds to return from this method, or iOS will terminate your application.
        //
        public override bool FinishedLaunching(UIApplication app, NSDictionary options)
        {
            global::Xamarin.Forms.Forms.Init();
            FormsMaps.Init();
            SvgImageRenderer.Init();
            ExtendedTextCellRenderer.Init();
            RoundedBoxViewRenderer.Init();

            global::Xamarin.Forms.Forms.ViewInitialized += (object sender, ViewInitializedEventArgs e) => {
                // http://developer.xamarin.com/recipes/testcloud/set-accessibilityidentifier-ios/
                if (null != e.View.StyleId)
                {
                    e.NativeView.AccessibilityIdentifier = e.View.StyleId;
                    Console.WriteLine("Set AccessibilityIdentifier: " + e.View.StyleId);
                }
            };

                        #if DEBUG
            // requires Xamarin Test Cloud Agent component
            Calabash.Start();
                        #endif

            LoadApplication(new App());

            return(base.FinishedLaunching(app, options));
        }
Ejemplo n.º 2
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            TabLayoutResource = Resource.Layout.Tabbar;
            ToolbarResource   = Resource.Layout.Toolbar;

            base.OnCreate(savedInstanceState);

            Popup.Init(this, savedInstanceState);
            Config.Init(this, savedInstanceState);
            CrossCurrentActivity.Current.Init(this, savedInstanceState);
            CrossFingerprint.SetCurrentActivityResolver(() => CrossCurrentActivity.Current.Activity);

            UserDialogs.Init(this);

            PullToRefreshLayoutRenderer.Init();

            CachedImageRenderer.Init(true);

            Platform.Init(this, savedInstanceState);
            Forms.Init(this, savedInstanceState);
            Xamarin.FormsMaps.Init(this, savedInstanceState);
            CardsViewRenderer.Preserve();
            RoundedBoxViewRenderer.Init();
            LoadApplication(new App());
        }
Ejemplo n.º 3
0
        public override bool FinishedLaunching(UIApplication app, NSDictionary options)
        {
            global::Xamarin.Forms.Forms.Init();
            Xamarin.FormsMaps.Init();
            XamForms.Controls.iOS.Calendar.Init();


            RoundedBoxViewRenderer.Init();

            /*
             * if (UIDevice.CurrentDevice.CheckSystemVersion(8, 0))
             * {
             *      var pushSettings = UIUserNotificationSettings.GetSettingsForTypes(
             *                 UIUserNotificationType.Alert | UIUserNotificationType.Badge | UIUserNotificationType.Sound,
             *                 new NSSet());
             *
             *      UIApplication.SharedApplication.RegisterUserNotificationSettings(pushSettings);
             *      UIApplication.SharedApplication.RegisterForRemoteNotifications();
             * }
             * else
             * {
             *      UIRemoteNotificationType notificationTypes = UIRemoteNotificationType.Alert | UIRemoteNotificationType.Badge | UIRemoteNotificationType.Sound;
             *      UIApplication.SharedApplication.RegisterForRemoteNotificationTypes(notificationTypes);
             * }*/

            LoadApplication(new App());

            return(base.FinishedLaunching(app, options));
        }
Ejemplo n.º 4
0
        //
        // This method is invoked when the application has loaded and is ready to run. In this
        // method you should instantiate the window, load the UI into it and then make the window
        // visible.
        //
        // You have 17 seconds to return from this method, or iOS will terminate your application.
        //
        public override bool FinishedLaunching(UIApplication app, NSDictionary options)
        {
            global::Xamarin.Forms.Forms.Init();
            Xamarin.FormsMaps.Init();
            ImageCircleRenderer.Init();
            RoundedBoxViewRenderer.Init();
            DependencyService.Register <ToastNotification>();
            ToastNotification.Init();

            LoadApplication(new App());

            // Request Permissions
            if (UIDevice.CurrentDevice.CheckSystemVersion(10, 0))
            {
                // Request Permissions
                UNUserNotificationCenter.Current.RequestAuthorization(UNAuthorizationOptions.Alert | UNAuthorizationOptions.Badge | UNAuthorizationOptions.Sound, (granted, error) =>
                {
                });
                // Watch for notifications while app is active
                UNUserNotificationCenter.Current.Delegate = new UserNotificationCenterDelegate();
            }
            else if (UIDevice.CurrentDevice.CheckSystemVersion(8, 0))
            {
                var notificationSettings = UIUserNotificationSettings.GetSettingsForTypes(
                    UIUserNotificationType.Alert | UIUserNotificationType.Badge | UIUserNotificationType.Sound, null);

                app.RegisterUserNotificationSettings(notificationSettings);
            }

            return(base.FinishedLaunching(app, options));
        }
Ejemplo n.º 5
0
        protected override void OnCreate(Bundle bundle)
        {
            var db = Realm.GetInstance();

            db.Dispose();
            TabLayoutResource = Resource.Layout.Tabbar;
            ToolbarResource   = Resource.Layout.Toolbar;

            base.OnCreate(bundle);

            global::Xamarin.Forms.Forms.Init(this, bundle);
            ImageCircleRenderer.Init();

            Window window = this.Window;

            window.ClearFlags(WindowManagerFlags.TranslucentStatus);
            window.AddFlags(WindowManagerFlags.DrawsSystemBarBackgrounds);
            window.SetStatusBarColor(Android.Graphics.Color.Rgb(251, 67, 60));
            LoadApplication(new App());
            TintedImageRenderer.Init();
            CarouselViewRenderer.Init();
            RoundedBoxViewRenderer.Init();
            CachedImageRenderer.Init(enableFastRenderer: true);

            OneSignal.Current.StartInit("84ec0128-74a1-40f9-89b1-35e35da35acd")
            .EndInit();

            if (IsPlayServicesAvailable())
            {
                var intent = new Intent(this, typeof(RegistrationIntentService));
                StartService(intent);
            }
        }
Ejemplo n.º 6
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            // ServicePointManager.ServerCertificateValidationCallback += (sender, cert, chain, sslPolicyErrors) => true;
            base.OnCreate(savedInstanceState);
            try
            {
                Xamarin.Essentials.Platform.Init(this, savedInstanceState);
                Forms.Init(this, savedInstanceState);
                FormsMaps.Init(this, savedInstanceState);
                Forms.SetTitleBarVisibility(this, AndroidTitleBarVisibility.Never);



                App ap = new MEI.App();
                LoadApplication(ap);
                //this.ActionBar.Hide();
                CachedImageRenderer.Init(enableFastRenderer: true);
                RoundedBoxViewRenderer.Init();
                RequestPermissions(permisons, 0);
                App.ScreenWidth           = (int)Resources.DisplayMetrics.WidthPixels;
                App.ScreenHeight          = (int)Resources.DisplayMetrics.HeightPixels;
                App.CopyToClipBoard       = CopyText;
                App.createContact         = CreateContact;
                App.localPushNotification = LocalNotification;
                App.SaveUser              = SaveUserID;
                App.GetUserEvent          = SetGetUser;
                App.AppVersion            = ApplicationContext.PackageManager.GetPackageInfo(ApplicationContext.PackageName, 0).VersionName;
                App.cropImage             = CropImage;
                App.ResetUser             = ResetUserID;
                App.closeApp              = CloseApp;
                App.SetDomainData         = SetDomainData;
                App.SetNotificaiton       = SetNotification;
                App.resetRoundView        = ResetRoundView;
                App.SetNotificationSounds = SetNotificationSound;
                App.SetUserData           = SetUserData;
                App.PushNotification      = AndroidPushNotification;
                App.AddEventReminder      = SetCurrentEventReminder;
                ISharedPreferences pref = GetSharedPreferences("MEI_UserPreferences", FileCreationMode.Private);
                bool hasDirectory       = pref.Contains("DomainDirectory");
                if (!hasDirectory)
                {
                    ISharedPreferencesEditor editor = pref.Edit();
                    editor.Clear();
                    editor.Apply();
                    editor.PutBoolean("DomainDirectory", App.NotificationSounds);
                    editor.Apply();
                }
                GetDomainData();
                GetNotification();
                GetUserData();
                GetNotificationSound();
                //FirebasePushNotificationManager.ProcessIntent(this, Intent);
                ap.StartApp();
            }
            catch (Exception e)
            {
                Console.WriteLine(e.ToString());
                Log.Debug("Creation Error", "Error in creating Application..");
            }
        }
Ejemplo n.º 7
0
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);

            Xamarin.Forms.Forms.Init(this, bundle);
            FormsMaps.Init(this, bundle);
            SvgImageRenderer.Init();
            ExtendedTextCellRenderer.Init();
            ExtendedMapRenderer.Init();
            RoundedBoxViewRenderer.Init();


            // http://forums.xamarin.com/discussion/21148/calabash-and-xamarin-forms-what-am-i-missing
            global::Xamarin.Forms.Forms.ViewInitialized += (object sender, Xamarin.Forms.ViewInitializedEventArgs e) => {
                if (!string.IsNullOrWhiteSpace(e.View.StyleId))
                {
                    if (e.NativeView != null)
                    {
                        e.NativeView.ContentDescription = e.View.StyleId;
                    }
                }
            };

            LoadApplication(new App());
        }
Ejemplo n.º 8
0
        public override bool FinishedLaunching(UIApplication app, NSDictionary options)
        {
            global::Xamarin.Forms.Forms.Init();
            global::Xamarin.FormsMaps.Init();
            LoadApplication(new App());
            navController = new UINavigationController();
            NSError err;

            FFImageLoading.Forms.Platform.CachedImageRenderer.Init();
            RoundedBoxViewRenderer.Init();

            App.createContact         = CreateContact;
            App.CopyToClipBoard       = CopyText;
            App.localPushNotification = PushNotification;
            App.SaveUser              = SaveUser;
            App.GetUserEvent          = SetGetUser;
            App.ResetUser             = ResetUser;
            App.cropImage             = CropImage;
            App.AppVersion            = (NSBundle.MainBundle.InfoDictionary["CFBundleVersion"] as NSString).ToString();
            App.SetNotificaiton       = SetNotification;
            App.SetNotificationSounds = SetNotificationSound;
            App.SetDomainData         = SaveDomainData;
            App.AddEventReminder      = AddEventToCalender;
            App.registerPhoneToServer = AddUserPhoneTOGCM;
            App.SetUserData           = SaveUserData;
            App.iosMapClick           = OpenPin;
            if (NSUserDefaults.StandardUserDefaults.ValueForKey(new NSString("DirectoryUpdate")) == null)
            {
                NSUserDefaults.StandardUserDefaults.SetBool(true, "DirectoryUpdate");
                ResetUser(this, null);
            }
            GetDomainData();
            GetUserData();
            GetNotification();
            GetNotificationSound();
            UIApplication.SharedApplication.SetStatusBarStyle(UIStatusBarStyle.LightContent, false);
            Firebase.Core.App.Configure();
            CrossBadge.Current.ClearBadge();
            if (UIDevice.CurrentDevice.CheckSystemVersion(10, 0))
            {
                // iOS 10 or later
                var authOptions = UNAuthorizationOptions.Alert | UNAuthorizationOptions.Badge | UNAuthorizationOptions.Sound;
                UNUserNotificationCenter.Current.RequestAuthorization(authOptions, (granted, error) =>
                {
                    Console.WriteLine(granted);
                });

                UNUserNotificationCenter.Current.Delegate = this;
                UNUserNotificationCenter.Current.GetNotificationSettings((settings) =>
                {
                    var alertsAllowed = (settings.AlertSetting == UNNotificationSetting.Enabled);
                });
                Messaging.SharedInstance.Delegate = this;
            }
            Messaging.SharedInstance.ShouldEstablishDirectChannel = true;
            UIApplication.SharedApplication.RegisterForRemoteNotifications();
            UIApplication.SharedApplication.SetStatusBarStyle(UIStatusBarStyle.LightContent, false);
            return(base.FinishedLaunching(app, options));
        }
Ejemplo n.º 9
0
        public override bool FinishedLaunching(UIApplication app, NSDictionary options)
        {
            global::Xamarin.Forms.Forms.Init();
            RoundedBoxViewRenderer.Init();
            LoadApplication(new App());

            return(base.FinishedLaunching(app, options));
        }
Ejemplo n.º 10
0
        public MainPage()
        {
            InitializeComponent();
            SupportedOrientations = SupportedPageOrientation.PortraitOrLandscape;

            Forms.Init();
            RoundedBoxViewRenderer.Init();

            LoadApplication(new SampleApp.App());
        }
Ejemplo n.º 11
0
        public override bool FinishedLaunching(UIApplication app, NSDictionary options)
        {
            global::Xamarin.Forms.Forms.Init();
            SegmentedControlRenderer.Init();
            Xamarin.FormsGoogleMaps.Init(Config.google_maps_ios_api_key);
            RoundedBoxViewRenderer.Init();
            LoadApplication(new App());

            return(base.FinishedLaunching(app, options));
        }
Ejemplo n.º 12
0
        public MainPage()
        {
            this.InitializeComponent();

            Xamarin.FormsMaps.Init(AppSettings.BingMapsAPIKey);
            LoadApplication(new Clients.App());
            RoundedBoxViewRenderer.Init();

            NativeCustomize();
        }
Ejemplo n.º 13
0
 //
 // This method is invoked when the application has loaded and is ready to run. In this
 // method you should instantiate the window, load the UI into it and then make the window
 // visible.
 //
 // You have 17 seconds to return from this method, or iOS will terminate your application.
 //
 public override bool FinishedLaunching(UIApplication app, NSDictionary options)
 {
     global::Xamarin.Forms.Forms.Init();
     SfDataGridRenderer.Init();
     LoadApplication(new App(new iOSInitializer()));
     new SfBusyIndicatorRenderer();
     new SfTreeMapRenderer();
     ImageCircleRenderer.Init();
     RoundedBoxViewRenderer.Init();
     return(base.FinishedLaunching(app, options));
 }
Ejemplo n.º 14
0
        protected override void OnCreate(Bundle bundle)
        {
            TabLayoutResource = Resource.Layout.Tabbar;
            ToolbarResource   = Resource.Layout.Toolbar;

            base.OnCreate(bundle);

            global::Xamarin.Forms.Forms.Init(this, bundle);
            RoundedBoxViewRenderer.Init();
            LoadApplication(new App(new AndroidInitializer()));
        }
Ejemplo n.º 15
0
        public override bool FinishedLaunching(UIApplication app, NSDictionary options)
        {
            global::Xamarin.Forms.Forms.Init();
            RoundedBoxViewRenderer.Init();
            DependencyService.Register <ToastNotificatorImplementation>();
            ToastNotificatorImplementation.Init();

            LoadApplication(new App());
            imprimirFuentes();
            return(base.FinishedLaunching(app, options));
        }
Ejemplo n.º 16
0
        protected override void OnCreate(Bundle bundle)
        {
            FormsAppCompatActivity.ToolbarResource   = Resource.Layout.toolbar;
            FormsAppCompatActivity.TabLayoutResource = Resource.Layout.tabs;

            base.OnCreate(bundle);

            global::Xamarin.Forms.Forms.Init(this, bundle);

            RoundedBoxViewRenderer.Init();
            LoadApplication(new App());
        }
        public override bool FinishedLaunching(UIApplication app, NSDictionary options)
        {
            global::Xamarin.Forms.Forms.Init();
            RoundedBoxViewRenderer.Init();
            CarouselViewRenderer.Init();
            SegmentedControlRenderer.Init();

            XamForms.Controls.iOS.Calendar.Init();
            mainForms = new App();
            LoadApplication(mainForms);

            return(base.FinishedLaunching(app, options));
        }
Ejemplo n.º 18
0
        // Constructor
        public MainPage()
        {
            InitializeComponent();

            Xamarin.Forms.Forms.Init();
            FormsMaps.Init();
            SvgImageRenderer.Init();
            ExtendedTextCellRenderer.Init();
            ExtendedMapRenderer.Init();
            RoundedBoxViewRenderer.Init();

            LoadApplication(new PluginSampleApp.App());
        }
Ejemplo n.º 19
0
        public MainPage()
        {
            this.InitializeComponent();

            LoadApplication(new Client.App());
            Xamarin.FormsMaps.Init(GlobalSetting.BingMapsAPIKey);
            ImageCircleRenderer.Init();
            RoundedBoxViewRenderer.Init();
            DependencyService.Register <ToastNotification>();
            ToastNotification.Init();

            NativeCustomize();
        }
Ejemplo n.º 20
0
        //
        // This method is invoked when the application has loaded and is ready to run. In this
        // method you should instantiate the window, load the UI into it and then make the window
        // visible.
        //
        // You have 17 seconds to return from this method, or iOS will terminate your application.
        //
        public override bool FinishedLaunching(UIApplication app, NSDictionary options)
        {
            ServicePointManager.ServerCertificateValidationCallback += (o, certificate, chain, errors) => true;
            global::Xamarin.Forms.Forms.Init();
            SlideOverKit.iOS.SlideOverKit.Init();
            CachedImageRenderer.Init();
            RoundedBoxViewRenderer.Init();
            FloatingActionButtonRenderer.InitRenderer();

            LoadApplication(new App());

            return(base.FinishedLaunching(app, options));
        }
        protected override void OnCreate(Bundle savedInstanceState)
        {
            TabLayoutResource = Resource.Layout.Tabbar;
            ToolbarResource   = Resource.Layout.Toolbar;

            base.OnCreate(savedInstanceState);

            ServicePointManager.ServerCertificateValidationCallback += (o, certificate, chain, errors) => true;
            Xamarin.Forms.Forms.Init(this, savedInstanceState);
            CachedImageRenderer.Init(enableFastRenderer: true);
            RoundedBoxViewRenderer.Init();

            LoadApplication(new App());
        }
Ejemplo n.º 22
0
        protected override void OnCreate(Bundle bundle)
        {
            TabLayoutResource = Resource.Layout.Tabbar;
            ToolbarResource   = Resource.Layout.Toolbar;

            base.OnCreate(bundle);

            global::Xamarin.Forms.Forms.Init(this, bundle);
            SegmentedControlRenderer.Init();
            Xamarin.FormsGoogleMaps.Init(this, bundle);
            Plugin.CurrentActivity.CrossCurrentActivity.Current.Activity = this;
            RoundedBoxViewRenderer.Init();
            LoadApplication(new App());
        }
Ejemplo n.º 23
0
        public override bool FinishedLaunching(UIApplication app, NSDictionary options)
        {
            global::Xamarin.Forms.Forms.Init();
            RoundedBoxViewRenderer.Init();
            CachedImageRenderer.Init();

            // Code for starting up the Xamarin Test Cloud Agent
#if ENABLE_TEST_CLOUD
            Xamarin.Calabash.Start();
#endif

            LoadApplication(new App());

            return(base.FinishedLaunching(app, options));
        }
Ejemplo n.º 24
0
        //
        // This method is invoked when the application has loaded and is ready to run. In this
        // method you should instantiate the window, load the UI into it and then make the window
        // visible.
        //
        // You have 17 seconds to return from this method, or iOS will terminate your application.
        //
        public override bool FinishedLaunching(UIApplication uiApplication, NSDictionary launchOptions)
        {
            Popup.Init();
            Config.Init();
            PullToRefreshLayoutRenderer.Init();
            CachedImageRenderer.Init();

            Forms.Init();
            CardsViewRenderer.Preserve();
            RoundedBoxViewRenderer.Init();
            ImageCircleRenderer.Init();
            Xamarin.FormsMaps.Init();
            LoadApplication(new App());

            return(base.FinishedLaunching(uiApplication, launchOptions));
        }
Ejemplo n.º 25
0
        public override bool FinishedLaunching(UIApplication uiApplication, NSDictionary launchOptions)
        {
            ZXing.Net.Mobile.Forms.iOS.Platform.Init();

            XFGloss.iOS.Library.Init();
            XamEffects.iOS.Effects.Init();
            RoundedBoxViewRenderer.Init();
            ProgressRingRenderer.Init();
            Xamarin.FormsMaps.Init();
            Xamarin.FormsGoogleMaps.Init("AIzaSyDnC69vNlEd0nv9-nnI5NDFY2zj6WChPOw");
            Stormlion.PhotoBrowser.iOS.Platform.Init();

            global::Xamarin.Forms.Forms.Init();

            RegisterServiceContainers();

            //Countly initialization
            var config = new CountlyConfig()
            {
                AppKey = Config.CountlyAppKey,
                Host   = Config.CountlyServerURL,
                //EnableDebug = true,
                Features = new NSObject[] { CountlySDK.Constants.CLYCrashReporting }
            };

            Countly.SharedInstance().StartWithConfig(config);
            Countly.SharedInstance().BeginSession();

            LoadApplication(new App());

            uiApplication.SetStatusBarStyle(UIStatusBarStyle.BlackOpaque, false);

            uiApplication.SetMinimumBackgroundFetchInterval(3600);

            if (UIDevice.CurrentDevice.CheckSystemVersion(8, 0))
            {
                var notificationSettings = UIUserNotificationSettings.GetSettingsForTypes(
                    UIUserNotificationType.Alert | UIUserNotificationType.Badge | UIUserNotificationType.Sound, null
                    );

                uiApplication.RegisterUserNotificationSettings(notificationSettings);
            }

            RegisterRemoteNotifications();

            return(base.FinishedLaunching(uiApplication, launchOptions));
        }
Ejemplo n.º 26
0
        protected override void OnCreate(Bundle bundle)
        {
            TabLayoutResource = Resource.Layout.Tabbar;
            ToolbarResource   = Resource.Layout.Toolbar;

            base.OnCreate(bundle);

            global::Xamarin.Forms.Forms.Init(this, bundle);
            Xamarin.FormsMaps.Init(this, bundle);
            UserDialogs.Init(this);
            ImageCircleRenderer.Init();
            RoundedBoxViewRenderer.Init();
            DependencyService.Register <ToastNotification>();
            ToastNotification.Init(this);

            LoadApplication(new App());
        }
Ejemplo n.º 27
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            TabLayoutResource = Resource.Layout.Tabbar;
            ToolbarResource   = Resource.Layout.Toolbar;

            base.OnCreate(savedInstanceState);
            Rg.Plugins.Popup.Popup.Init(this, savedInstanceState);
            App.DisplayScreenWidth  = (double)Resources.DisplayMetrics.WidthPixels / (double)Resources.DisplayMetrics.Density;
            App.DisplayScreenHeight = (double)Resources.DisplayMetrics.HeightPixels / (double)Resources.DisplayMetrics.Density;
            global::Xamarin.Forms.Forms.Init(this, savedInstanceState);
            CarouselViewRenderer.Init();
            RoundedBoxViewRenderer.Init();
            ImageCircleRenderer.Init();
            PullToRefreshLayoutRenderer.Init();
            DependencyService.Register <ToastNotificatorImplementation>();
            ToastNotificatorImplementation.Init(this);
            LoadApplication(new App());
        }
Ejemplo n.º 28
0
        /// <summary>
        /// Invoqué lorsque l'application est lancée normalement par l'utilisateur final.  D'autres points d'entrée
        /// seront utilisés par exemple au moment du lancement de l'application pour l'ouverture d'un fichier spécifique.
        /// </summary>
        /// <param name="e">Détails concernant la requête et le processus de lancement.</param>
        protected override void OnLaunched(LaunchActivatedEventArgs e)
        {
#if DEBUG
            if (System.Diagnostics.Debugger.IsAttached)
            {
                this.DebugSettings.EnableFrameRateCounter = true;
            }
#endif
            Frame rootFrame = Window.Current.Content as Frame;

            // Ne répétez pas l'initialisation de l'application lorsque la fenêtre comporte déjà du contenu,
            // assurez-vous juste que la fenêtre est active
            if (rootFrame == null)
            {
                // Créez un Frame utilisable comme contexte de navigation et naviguez jusqu'à la première page
                rootFrame = new Frame();

                rootFrame.NavigationFailed += OnNavigationFailed;

                Xamarin.Forms.Forms.Init(e);
                RoundedBoxViewRenderer.Init();

                if (e.PreviousExecutionState == ApplicationExecutionState.Terminated)
                {
                    //TODO: chargez l'état de l'application précédemment suspendue
                }

                // Placez le frame dans la fenêtre active
                Window.Current.Content = rootFrame;
            }

            if (e.PrelaunchActivated == false)
            {
                if (rootFrame.Content == null)
                {
                    // Quand la pile de navigation n'est pas restaurée, accédez à la première page,
                    // puis configurez la nouvelle page en transmettant les informations requises en tant que
                    // paramètre
                    rootFrame.Navigate(typeof(MainPage), e.Arguments);
                }
                // Vérifiez que la fenêtre actuelle est active
                Window.Current.Activate();
            }
        }
Ejemplo n.º 29
0
        //BluetoothConnection myConnection = new BluetoothCKConnection();
        protected override void OnCreate(Bundle bundle)
        {
            TabLayoutResource = Resource.Layout.Tabbar;
            ToolbarResource   = Resource.Layout.Toolbar;

            base.OnCreate(bundle);

            global::Xamarin.Forms.Forms.Init(this, bundle);
            RoundedBoxViewRenderer.Init();
            LoadApplication(new App());

            //    BluetoothSocket _socket = null;

            //    myConnection = new BluetoothConnection();
            //    myConnection.getAdapter();
            //    myConnection.thisAdapter.StartDiscovery();

            //    try
            //    {
            //        myConnection.getDevice();
            //        myConnection.thisDevice.SetPairingConfirmation(false);
            //        //   myConnection.thisDevice.Dispose();
            //        myConnection.thisDevice.SetPairingConfirmation(true);
            //        myConnection.thisDevice.CreateBond();
            //    }
            //    catch (Exception deviceEX)
            //    {
            //    }

            //    myConnection.thisAdapter.CancelDiscovery();

            //}
            //public class BluetoothConnection
            //{

            //    public void getAdapter() { this.thisAdapter = BluetoothAdapter.DefaultAdapter; }
            //    public void getDevice() { this.thisDevice = (from bd in this.thisAdapter.BondedDevices where bd.Name == "Loivi Fetz" select bd).FirstOrDefault(); }

            //    public BluetoothAdapter thisAdapter { get; set; }
            //    public BluetoothDevice thisDevice { get; set; }

            //    public BluetoothSocket thisSocket { get; set; }
        }
Ejemplo n.º 30
0
        protected override void OnCreate(Bundle bundle)
        {
            AndroidEnvironment.UnhandledExceptionRaiser += HandleAndroidException;


            base.OnCreate(bundle);
            Forms.Init(this, bundle);
            Xamarin.FormsMaps.Init(this, bundle);
            App.Version = ApplicationContext.PackageManager.GetPackageInfo(ApplicationContext.PackageName, 0).VersionName;
            UserDialogs.Init(this);
            RoundedBoxViewRenderer.Init();
            ImageCircleRenderer.Init();
            ZXing.Net.Mobile.Forms.Android.Platform.Init();
            //this is needed for UI testing
            Forms.ViewInitialized += (sender, e) =>
            {
                if (!String.IsNullOrWhiteSpace(e.View.StyleId))
                {
                    e.NativeView.ContentDescription = e.View.StyleId;
                }
            };

            // App.UserDialogService = new UserDialogService(); - OLD
            // COMMENT OUT TO CREATE NEW DB
            //InitializeDatabase ();
            InitializeDevice();
            App.Init(new AppSetup());
            LoadApplication(new App());

            var width   = Resources.DisplayMetrics.WidthPixels;
            var height  = Resources.DisplayMetrics.HeightPixels;
            var density = Resources.DisplayMetrics.Density;

            App.ScreenWidth  = (width - 0.5f) / density;
            App.ScreenHeight = (height - 0.5f) / density;

            App.AppLoadedDateTime = DateTime.UtcNow;


            var x = typeof(Xamarin.Forms.Themes.LightThemeResources);

            x = typeof(Xamarin.Forms.Themes.Android.UnderlineEffect);
        }