示例#1
0
        protected override async void OnCreate(Bundle savedInstanceState)
        {
            TabLayoutResource = Resource.Layout.Tabbar;
            ToolbarResource   = Resource.Layout.Toolbar;

            Instance = this;

            BackgroundAggregator.Init(this);

            base.OnCreate(savedInstanceState);

            await CrossMedia.Current.Initialize();

            Plugin.CurrentActivity.CrossCurrentActivity.Current.Init(this.Application);

            //MessagingCenter.Subscribe<StartLongRunningTaskMessage>(this, "StartLongRunningTaskMessage", message => {
            //    var intent = new Intent(this, typeof(LongRunningTaskService));
            //    StartService(intent);
            //});

            //MessagingCenter.Subscribe<StopLongRunningTaskMessage>(this, "StopLongRunningTaskMessage", message => {
            //    var intent = new Intent(this, typeof(LongRunningTaskService));
            //    StopService(intent);
            //});

            global::Xamarin.Forms.Forms.Init(this, savedInstanceState);
            LoadApplication(new App());
        }
示例#2
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            BackgroundAggregator.Init(this);
            Platform.Init(this, savedInstanceState);
            Forms.Init(this, savedInstanceState);
            FormsMaps.Init(this, savedInstanceState);
            CachedImageRenderer.Init(true);
            Instance = this;

            TabLayoutResource = Resource.Layout.Tabbar;
            ToolbarResource   = Resource.Layout.Toolbar;

            base.OnCreate(savedInstanceState);

            CheckPermissions();

            CrossCurrentActivity.Current.Init(this, savedInstanceState);

            DisplayLocationSettingsRequest();

            LoadApplication(new App());

            if (ContextCompat.CheckSelfPermission(this, Manifest.Permission.WriteExternalStorage) == Permission.Granted ||
                ContextCompat.CheckSelfPermission(this, Manifest.Permission.ReadExternalStorage) == Permission.Granted)
            {
                InitLog();
            }
        }
示例#3
0
        public MainPage()
        {
            this.InitializeComponent();

            BackgroundAggregator.Init(this);

            LoadApplication(new Xamarin_Forms_BackgroundSample.App());
        }
示例#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();
            LoadApplication(new App());

            BackgroundAggregator.Init(this);
            return(base.FinishedLaunching(app, options));
        }
示例#5
0
        public MainPage()
        {
            this.InitializeComponent();

            BackgroundAggregator.Init(this);

            LoadApplication(new XamaCounter.App());
        }
示例#6
0
        public MainPage()
        {
            this.InitializeComponent();

            BackgroundAggregator.Init(this);

            LoadApplication(new SampleBackground.App(new UwpInitializer()));
        }
示例#7
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            BackgroundAggregator.Init(this);

            base.OnCreate(savedInstanceState);

            Xamarin.Essentials.Platform.Init(this, savedInstanceState);
            global::Xamarin.Forms.Forms.Init(this, savedInstanceState);
            LoadApplication(new App());
        }
示例#8
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            TabLayoutResource = Resource.Layout.Tabbar;
            ToolbarResource   = Resource.Layout.Toolbar;

            BackgroundAggregator.Init(this);

            base.OnCreate(savedInstanceState);
            global::Xamarin.Forms.Forms.Init(this, savedInstanceState);
            LoadApplication(new App());
        }
示例#9
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)
        {
            Rg.Plugins.Popup.Popup.Init();

            global::Xamarin.Forms.Forms.Init();
            LoadApplication(new App());

            appDelegate = this;
            BackgroundAggregator.Init(this);
            return(base.FinishedLaunching(uiApplication, launchOptions));
        }
示例#10
0
        protected override void OnCreate(Bundle bundle)
        {
            TabLayoutResource = Resource.Layout.Tabbar;
            ToolbarResource   = Resource.Layout.Toolbar;

            base.OnCreate(bundle);

            BackgroundAggregator.Init(this);

            global::Xamarin.Forms.Forms.Init(this, bundle);
            LoadApplication(new App(new AndroidInitializer()));
        }
示例#11
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            TabLayoutResource = Resource.Layout.Tabbar;
            ToolbarResource   = Resource.Layout.Toolbar;
            Rg.Plugins.Popup.Popup.Init(this, savedInstanceState);
            BackgroundAggregator.Init(this);
            base.OnCreate(savedInstanceState);
            global::Xamarin.Forms.Forms.Init(this, savedInstanceState);
            LoadApplication(new App());

            _nfcAdapter = NfcAdapter.GetDefaultAdapter(this);
        }
示例#12
0
 protected override void OnCreate(Bundle savedInstanceState)
 {
     TabLayoutResource = Resource.Layout.Tabbar;
     ToolbarResource   = Resource.Layout.Toolbar;
     base.Window.RequestFeature(WindowFeatures.ActionBar);
     base.SetTheme(Resource.Style.MainTheme);
     base.OnCreate(savedInstanceState);
     Xamarin.Essentials.Platform.Init(this, savedInstanceState);
     Forms.Init(this, savedInstanceState);
     BackgroundAggregator.Init(this);
     XF.Material.Droid.Material.Init(this, savedInstanceState);
     LoadApplication(new App());
 }
示例#13
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            BackgroundAggregator.Init(this);

            TabLayoutResource = Resource.Layout.Tabbar;
            ToolbarResource   = Resource.Layout.Toolbar;

            base.OnCreate(savedInstanceState);
            global::Xamarin.Forms.Forms.SetFlags("Shell_Experimental");
            Xamarin.Essentials.Platform.Init(this, savedInstanceState);
            global::Xamarin.Forms.Forms.Init(this, savedInstanceState);
            LoadApplication(new App());
        }
示例#14
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)
        {
            //Background services configuration (Matcha)
            BackgroundAggregator.Init(this);

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

            UNUserNotificationCenter.Current.Delegate = new iOSNotificationReceiver();

            LoadApplication(new App());

            return(base.FinishedLaunching(app, options));
        }
示例#15
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            TryToGetPermissions();
            TabLayoutResource = Resource.Layout.Tabbar;
            ToolbarResource   = Resource.Layout.Toolbar;
            BackgroundAggregator.Init(this);
            base.OnCreate(savedInstanceState);
            Xamarin.Essentials.Platform.Init(this, savedInstanceState);
            global::Xamarin.Forms.Forms.Init(this, savedInstanceState);

            Plugin.InputKit.Platforms.Droid.Config.Init(this, savedInstanceState); // < ---- Add here

            _mScreenListener = new ScreenListener(this);

            LoadApplication(new App());
        }
示例#16
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            TabLayoutResource = Resource.Layout.Tabbar;
            ToolbarResource   = Resource.Layout.Toolbar;

            //Background services configuration (Matcha)
            BackgroundAggregator.Init(this);

            base.OnCreate(savedInstanceState);

            Xamarin.Essentials.Platform.Init(this, savedInstanceState);
            global::Xamarin.Forms.Forms.Init(this, savedInstanceState);
            LoadApplication(new App());

            global::Xamarin.Forms.Forms.Init(this, savedInstanceState);
            LoadApplication(new App());
            CreateNotificationFromIntent(Intent);
        }
示例#17
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            TabLayoutResource = Resource.Layout.Tabbar;
            ToolbarResource   = Resource.Layout.Toolbar;

            base.OnCreate(savedInstanceState);

            Xamarin.Essentials.Platform.Init(this, savedInstanceState);
            global::Xamarin.Forms.Forms.Init(this, savedInstanceState);

            string fileName     = "inbox_db.db3";
            string folderPath   = System.Environment.GetFolderPath(System.Environment.SpecialFolder.Personal);
            string completePath = Path.Combine(folderPath, fileName);

            BackgroundAggregator.Init(this);
            UserDialogs.Init(this);

            LoadApplication(new App(completePath));
        }
示例#18
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)
        {
            CachedImageRenderer.Init();
            Forms.Init();
            FormsMaps.Init();
            LoadApplication(new App());
            UIApplication.SharedApplication.SetMinimumBackgroundFetchInterval(1800000);

            BackgroundAggregator.Init(this);

            _showTrackingMap = new LocationCheck((s, ev) =>
            {
                Console.WriteLine(((LocationCheck.LocationCheckEventArgs)ev).Allowed ? "Present Tracking Map ViewController" : "Disable Tracking Map");

                _showTrackingMap.Dispose();
            });

            return(base.FinishedLaunching(app, options));
        }
示例#19
0
        protected override void OnCreate(Bundle bundle)
        {
            TabLayoutResource = Resource.Layout.Tabbar;
            ToolbarResource   = Resource.Layout.Toolbar;

            BackgroundAggregator.Init(this);

            base.OnCreate(bundle);


            Forms.SetFlags("FastRenderers_Experimental");


            global::Xamarin.Forms.Forms.Init(this, bundle);
            global::Xamarin.Forms.FormsMaterial.Init(this, bundle);
            UserDialogs.Init(this);
            // Xamarin.FormsMaps.Init(this, bundle);
            //  Xamarin.FormsGoogleMaps.Init(this, bundle);



            var platformConfig = new PlatformConfig
            {
                BitmapDescriptorFactory = new CachingNativeBitmapDescriptorFactory()
            };

            Xamarin.FormsGoogleMaps.Init(this, bundle, platformConfig); // initialize for Xamarin.Forms.GoogleMaps
            Xamarin.FormsGoogleMapsBindings.Init();
            Xamarin.Essentials.Platform.Init(this, bundle);
            // CrossCurrentActivity.Current.Init(this, bundle);

            LocationManager mlocManager = (LocationManager)GetSystemService(LocationService);

            App.IsGPSEnable = mlocManager.IsProviderEnabled(LocationManager.GpsProvider);
            ObterID();


            LoadApplication(new App(new AndroidInitializer()));
        }
示例#20
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            StrictMode.ThreadPolicy policy = new StrictMode.ThreadPolicy.Builder().PermitAll().Build();
            StrictMode.SetThreadPolicy(policy);

            TabLayoutResource = Resource.Layout.Tabbar;
            ToolbarResource   = Resource.Layout.Toolbar;

            base.OnCreate(savedInstanceState);

            BackgroundAggregator.Init(this);
            string filename     = "weather_db.sqlite";
            string filelocation = System.Environment.GetFolderPath(System.Environment.SpecialFolder.Personal);
            string full_path    = Path.Combine(filelocation, filename);

            string settings_path = Path.Combine(System.Environment.GetFolderPath(System.Environment.SpecialFolder.Personal), "settings_db.sqlite");
            string lgw_path      = Path.Combine(System.Environment.GetFolderPath(System.Environment.SpecialFolder.Personal), "lgweather_db.sqlite");
            string fw_path       = Path.Combine(System.Environment.GetFolderPath(System.Environment.SpecialFolder.Personal), "fweather_db.sqlite");

            Forms.Init(this, savedInstanceState);
            LoadApplication(new App(full_path, settings_path, lgw_path, fw_path));
            AiForms.Renderers.Droid.SettingsViewInit.Init(); // need to write here
            startrunservice();
        }
示例#21
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)
        {
            string filename     = "weather_db.sqlite";
            string filelocation = Path.Combine(System.Environment.GetFolderPath(System.Environment.SpecialFolder.Personal), "..", "Library");
            string full_path    = Path.Combine(filelocation, filename);

            string settings_path = Path.Combine(System.Environment.GetFolderPath(System.Environment.SpecialFolder.Personal), "..", "Library", "settings_db.sqlite");
            string lgw_path      = Path.Combine(System.Environment.GetFolderPath(System.Environment.SpecialFolder.Personal), "..", "Library", "lgweather_db.sqlite");
            string fw_path       = Path.Combine(System.Environment.GetFolderPath(System.Environment.SpecialFolder.Personal), "..", "Library", "fweather_db.sqlite");

            global::Xamarin.Forms.Forms.Init();
            //AiForms.Renderers.iOS.SettingsViewInit.Init();


            LoadApplication(new App(full_path, settings_path, lgw_path, fw_path));


            if (UIDevice.CurrentDevice.CheckSystemVersion(10, 0))
            {
                // Ask the user for permission to get notifications on iOS 10.0+
                UNUserNotificationCenter.Current.RequestAuthorization(
                    UNAuthorizationOptions.Alert | UNAuthorizationOptions.Badge | UNAuthorizationOptions.Sound,
                    (approved, error) => { });
            }
            else if (UIDevice.CurrentDevice.CheckSystemVersion(8, 0))
            {
                // Ask the user for permission to get notifications on iOS 8.0+
                var settings = UIUserNotificationSettings.GetSettingsForTypes(
                    UIUserNotificationType.Alert | UIUserNotificationType.Badge | UIUserNotificationType.Sound,
                    new NSSet());

                UIApplication.SharedApplication.RegisterUserNotificationSettings(settings);
            }
            BackgroundAggregator.Init(this);
            return(base.FinishedLaunching(app, options));
        }
示例#22
0
 public MainPage()
 {
     this.InitializeComponent();
     BackgroundAggregator.Init(this);
     LoadApplication(new PlacesContact.App());
 }
        protected override void OnCreate(Bundle savedInstanceState)
        {
            TabLayoutResource = Resource.Layout.Tabbar;
            ToolbarResource   = Resource.Layout.Toolbar;

            base.OnCreate(savedInstanceState);

            BackgroundAggregator.Init(this);

            Xamarin.Essentials.Platform.Init(this, savedInstanceState);
            global::Xamarin.Forms.Forms.Init(this, savedInstanceState);

            // LoadApplication(new App());

            var alarmIntent = new Intent(this, typeof(BackgroundReceiver));
            var pending     = PendingIntent.GetBroadcast(this, 0, alarmIntent, PendingIntentFlags.UpdateCurrent);

            var alarmManager = GetSystemService(AlarmService).JavaCast <AlarmManager>();

            alarmManager.SetRepeating(AlarmType.RtcWakeup, 0, 1 * 10, pending);


            IVDICommonBleReader mBleReader;

#pragma warning disable CS0618 // Type or member is obsolete
            var sdk = Convert.ToInt32(Build.VERSION.Sdk);
#pragma warning restore CS0618 // Type or member is obsolete
            if (sdk >= 21)
            {
                mBleReader = new VDIBleThermometerL(this);
            }
            else
            {
                mBleReader = new VDIBleThermometer(this);
            }
            // mBleReader.SetListener();
            mBleReader.StartDeviceDiscovery();
            mBleReader.StopDeviceDiscovery();
            var bluetoothStatus = mBleReader.CheckBle();
            if (bluetoothStatus == VDIType.CHECKBLE_STATUS_TYPE.SystemBleNotEnabled)
            {
                // Do Sth
            }
            else if (bluetoothStatus == VDIType.CHECKBLE_STATUS_TYPE.SystemLocationNotEnabled)
            {
                // Do Sth
            }
            else if (bluetoothStatus == VDIType.CHECKBLE_STATUS_TYPE.SystemNotSupportBle)
            {
                // Do Sth
            }
            else if (bluetoothStatus == VDIType.CHECKBLE_STATUS_TYPE.ResultOk)
            {
                // Do Sth
            }
            else
            {
                // Do Sth
            }
            mBleReader.AddPDList("deviceId");
            mBleReader.AddPDList("deviceId", "password");
            mBleReader.RemovePDList("deviceId");
            mBleReader.PurgePDList();
            var pdListLength = mBleReader.PDListLength;
            mBleReader.StartTemperatureUpdate();
            mBleReader.StopTemperatureUpdate();
            if (Build.Manufacturer?.ToLower() == "samsung")
            {
                if (Build.VERSION.PreviewSdkInt >= 23)
                {
                    var serviceIntent = new Intent(this, typeof(VDIBleService));
                    StartService(serviceIntent);
                    BindService(serviceIntent, null, 0);
                }
            }
            var chargerInfo = new ChargerInfo("chie?", "chie??", VDIType.CHARGER_BATTERY_STATUS.Low, 0.3f);
            // var deviceInfo = new DeviceInfo();
        }