Beispiel #1
0
        protected override void OnCreate(Bundle bundle)
        {
            Plugin.CurrentActivity.CrossCurrentActivity.Current.Activity = this;

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

            base.Window.RequestFeature(WindowFeatures.ActionBar);
            // Name of the MainActivity theme you had there before.
            // Or you can use global::Android.Resource.Style.ThemeHoloLight
            base.SetTheme(Resource.Style.MainTheme);

            base.OnCreate(bundle);

            //Set up barcode scanner
            ZXing.Net.Mobile.Forms.Android.Platform.Init();

            // Set up Raygun:
            Mindscape.Raygun4Net.RaygunClient.Attach("hURdLjAIGA8RoM2KPyBbXw==");

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

            //test
            AidcManager.Create(this, this);

            LoadApplication(new App());
        }
Beispiel #2
0
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);

            // Set our view from the "main" layout resource
            SetContentView(Resource.Layout.Main);

            _automaticButton     = (Button)FindViewById <Button>(Resource.Id.buttonAutomaticBarcode);
            _clientButton        = (Button)FindViewById <Button>(Resource.Id.buttonClientBarcode);
            _manualTriggerButton = (Button)FindViewById <Button>(Resource.Id.buttonManualTriggerBarcode);

            _automaticButton.Click     += _automaticButton_Click;
            _clientButton.Click        += _clientButton_Click;;
            _manualTriggerButton.Click += _manualTriggerButton_Click;;

            AidcManager.Create(this, this);
        }
        /// <summary>
        /// This method initiates the connection to the Data Collection Service
        /// by creating an AidcManager object. The AidcManager object is returned
        /// so it can be used to create the Java BarcodeReader objects.
        /// </summary>
        /// <returns>A Java AidcManager object.</returns>
        internal AidcManager Init()
        {
            if (sAidcManager == null)
            {
                lock (oInitLock)
                {
                    try
                    {
                        Logger.Debug("BarcodeReader", "Creating AidcManager");

                        AidcManager.Create(mAppContext, this);

                        sServiceConnectedEvent?.WaitOne();
                    }
                    catch (Java.Lang.Exception ex)
                    {
                        Logger.Error("BarcodeReader", "Exception in creating AidcManager, " + ex.Message);
                    }
                }
            }

            return(sAidcManager);
        }