Exemplo n.º 1
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);
            SetContentView(Resource.Layout.ScanCodeQR);

            _surfaceView = FindViewById <SurfaceView>(Resource.Id.cameraView);
            _txtResult   = FindViewById <TextView>(Resource.Id.txtResult);

            // Traemos la barra toobar
            Toolbar toolBar = FindViewById <Toolbar>(Resource.Id.toolbar);

            SetSupportActionBar(toolBar);

            // Una marca atrás en el icono en ActionBar
            SupportActionBar.SetDisplayHomeAsUpEnabled(true);

            // Creo el detector qr
            _barcodeDetector = new BarcodeDetector.Builder(this)
                               .SetBarcodeFormats(BarcodeFormat.QrCode)
                               .Build();

            // Creo la camara
            _cameraSource = new CameraSource.Builder(this, _barcodeDetector)
                            .SetRequestedPreviewSize(1600, 1024)
                            .SetAutoFocusEnabled(true)
                            .Build();

            _surfaceView.Holder.AddCallback(this);
            _barcodeDetector.SetProcessor(this);
        }
Exemplo n.º 2
0
        public CameraPreview(Context context, bool defaultTorchOn, bool virbationOnDetected, bool startScanningOnCreate)
            : base(context)
        {
            Configuration.IsScanning = startScanningOnCreate;
            _windowManager           = Context.GetSystemService(Context.WindowService).JavaCast <IWindowManager>();
            _barcodeDetector         = new BarcodeDetector.Builder(context)
                                       .SetBarcodeFormats(Configuration.BarcodeFormats)
                                       .Build();
            _cameraSource = new CameraSource
                            .Builder(context, _barcodeDetector)
                            .SetRequestedPreviewSize(1280, 720)
                            .SetAutoFocusEnabled(true)
                            .Build();
            Configuration.CameraSource = _cameraSource;
            _surfaceView = new SurfaceView(context);
            _surfaceView.Holder.AddCallback(new SurfaceHolderCallback(_cameraSource, _surfaceView));
            AddView(_surfaceView);

            var detectProcessor = new DetectorProcessor(context, virbationOnDetected);

            detectProcessor.OnDetected += DetectProcessor_OnDetected;
            _barcodeDetector.SetProcessor(detectProcessor);
            if (defaultTorchOn)
            {
                AutoSwitchOnTorch();
            }
        }
Exemplo n.º 3
0
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);
            SetContentView(Resource.Layout.QR_Code);

            cameraPreview = FindViewById <SurfaceView>(Resource.Id.cameraPreview);
            txtResult     = FindViewById <TextView>(Resource.Id.txtResult);
            BackButton    = FindViewById <Button>(Resource.Id.BackButton);

            barcodeDetector = new BarcodeDetector.Builder(this)
                              .SetBarcodeFormats(BarcodeFormat.QrCode)
                              .Build();
            cameraSource = new CameraSource
                           .Builder(this, barcodeDetector)
                           .SetRequestedPreviewSize(640, 480)
                           .Build();

            cameraPreview.Holder.AddCallback(this);
            barcodeDetector.SetProcessor(this);
            //ustawienie kontrolek i elementów

            BackButton.Click += delegate  //obsługa powrotu do wyszukiwarki
            {
                Intent intent = new Intent(this, typeof(Wyszukiwarka));
                this.StartActivity(intent);
                Finish();
            };
        }
Exemplo n.º 4
0
        private void BindResources()
        {
            var toolbar = FindViewById <CenteredToolbar>(Resource.Id.toolbar);

            toolbar.SetTitle(Resource.String.new_device_scan_title);

            var layout = FindViewById <LinearLayout>(Resource.Id.instruction);

            var instructionNumber = layout.FindViewById <AppCompatTextView>(Resource.Id.instruction_number);
            var instructionText   = layout.FindViewById <AppCompatTextView>(Resource.Id.instruction_text);

            statusLabel = FindViewById <AppCompatTextView>(Resource.Id.status_label);

            instructionNumber.Text = "3";
            instructionText.SetText(Resource.String.scan_qr_message_label);

            SetSupportActionBar(toolbar);
            this.BackPressed += NewDeviceSetupActivity_BackPressed;
            SupportActionBar.SetDisplayHomeAsUpEnabled(true);
            SupportActionBar.SetHomeButtonEnabled(true);

            surfaceView = FindViewById <SurfaceView>(Resource.Id.cameraView);

            barcodeDetector = new BarcodeDetector.Builder(this)
                              .SetBarcodeFormats(BarcodeFormat.QrCode)
                              .Build();

            cameraSource = new CameraSource
                           .Builder(this, barcodeDetector)
                           .SetRequestedPreviewSize(640, 480)
                           .Build();

            surfaceView.Holder.AddCallback(this);
            barcodeDetector.SetProcessor(this);
        }
Exemplo n.º 5
0
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);
            SetContentView(Resource.Layout.CodeSelection);

            cameraPreview = FindViewById <SurfaceView>(Resource.Id.cameraPreview);
            txtResult     = FindViewById <TextView>(Resource.Id.txtResult);

            if (MainActivity.pressedButton == 1)
            {
                barcodeDetector = new BarcodeDetector.Builder(this)
                                  .SetBarcodeFormats(BarcodeFormat.QrCode)
                                  .Build();

                cameraSource = new CameraSource
                               .Builder(this, barcodeDetector)
                               .SetRequestedPreviewSize(640, 480)
                               .Build();

                txtResult.SetText(Resource.String.qrS);
            }
            else if (MainActivity.pressedButton == 2)
            {
                barcodeDetector = new BarcodeDetector.Builder(this)
                                  .SetBarcodeFormats(BarcodeFormat.Code128)
                                  .Build();

                cameraSource = new CameraSource
                               .Builder(this, barcodeDetector)
                               .SetRequestedPreviewSize(640, 480)
                               .Build();

                txtResult.SetText(Resource.String.codeS);
            }
            else if (MainActivity.pressedButton == 3)
            {
                barcodeDetector = new BarcodeDetector.Builder(this)
                                  .SetBarcodeFormats(BarcodeFormat.Ean13)
                                  .Build();

                cameraSource = new CameraSource
                               .Builder(this, barcodeDetector)
                               .SetRequestedPreviewSize(640, 480)
                               .Build();

                txtResult.SetText(Resource.String.eanS);
            }

            cameraPreview.Holder.AddCallback(this);
            barcodeDetector.SetProcessor(this);
        }
Exemplo n.º 6
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);

            SetContentView(Resource.Layout.BarcodeScannerLayout);
            FindViews();
            HandleEvents();

            _barcodeDetector = new BarcodeDetector.Builder(this).SetBarcodeFormats(BarcodeFormat.QrCode | BarcodeFormat.DataMatrix | BarcodeFormat.Codabar | BarcodeFormat.Code128 | BarcodeFormat.Code39 | BarcodeFormat.Code93 | BarcodeFormat.Ean13 | BarcodeFormat.Ean8 | BarcodeFormat.Itf | BarcodeFormat.Pdf417 | BarcodeFormat.UpcA | BarcodeFormat.UpcE).Build();//setting specific barcode type

            _cameraSource = new CameraSource.Builder(this, _barcodeDetector).SetAutoFocusEnabled(true).SetRequestedPreviewSize(1000, 1000).Build();

            _cameraPreview.Holder.AddCallback(this);
            _barcodeDetector.SetProcessor(this);
        }
Exemplo n.º 7
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);

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

            previewCamara = FindViewById <SurfaceView>(Resource.Id.previewCamara);
            txtResultado  = FindViewById <TextView>(Resource.Id.txtResultado);
            detector      = new BarcodeDetector.Builder(this).SetBarcodeFormats(BarcodeFormat.QrCode).Build();
            camara        = new CameraSource.Builder(this, detector).SetRequestedPreviewSize(1280, 720).Build();

            previewCamara.Holder.AddCallback(this);
            detector.SetProcessor(this);
        }
 protected override void OnCreate(Bundle savedInstanceState)
 {
     base.OnCreate(savedInstanceState);
     SetContentView(Resource.Layout.activity_scan_vision);
     surfaceView     = FindViewById <SurfaceView>(Resource.Id.cameraView);
     txtResult       = FindViewById <TextView>(Resource.Id.txtResult);
     barcodeDetector = new BarcodeDetector.Builder(this)
                       .SetBarcodeFormats(BarcodeFormat.QrCode)
                       .Build();
     cameraSource = new CameraSource
                    .Builder(this, barcodeDetector)
                    .SetRequestedPreviewSize(640, 480)
                    .Build();
     surfaceView.Holder.AddCallback(this);
     barcodeDetector.SetProcessor(this);
 }
Exemplo n.º 9
0
        protected override void OnElementChanged(ElementChangedEventArgs <BarcodeScanner> e)
        {
            base.OnElementChanged(e);
            surfaceView = new SurfaceView(Context);
            surfaceView.Holder.AddCallback(this);
            SetNativeControl(surfaceView);

            Element.MaxZoom     = maxZoom;
            Element.SlideToZoom = 1;

            barcodeDetector = new BarcodeDetector.Builder(Context)
                              .SetBarcodeFormats(GetBarcodeFormat(Element.BarcodeType))
                              .Build();

            barcodeDetector.SetProcessor(this);
        }
Exemplo n.º 10
0
 protected override void OnCreate(Bundle savedInstanceState)
 {
     base.OnCreate(savedInstanceState);
     SetContentView(Resource.Layout.QR_layout);
     surfaceView = FindViewById <SurfaceView>(Resource.Id.surfaceView1);
     txtResult   = FindViewById <TextView>(Resource.Id.QR_textView);
     //Bitmap bitMap = BitmapFactory.DecodeResource(ApplicationContext.Resources, Resource.Drawable.qrcode);
     barcodeDetector = new BarcodeDetector.Builder(this)
                       .SetBarcodeFormats(BarcodeFormat.QrCode)
                       .Build();
     cameraSource = new CameraSource
                    .Builder(this, barcodeDetector)
                    .SetRequestedPreviewSize(640, 480)
                    .Build();
     surfaceView.Holder.AddCallback(this);
     barcodeDetector.SetProcessor(this);
 }
Exemplo n.º 11
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);

            // Create your application here
            SetContentView(Resource.Layout.QRCodeScanner);

            cameraPreview = FindViewById <SurfaceView>(Resource.Id.cameraPreview);
            txtResult     = FindViewById <TextView>(Resource.Id.cameraPreviewtetxtView);
            qrgenerator   = FindViewById <Button>(Resource.Id.qrgeneratorbutton);

            barcodeDetector = new BarcodeDetector.Builder(this).SetBarcodeFormats(BarcodeFormat.QrCode).Build();
            cameraSource    = new CameraSource.Builder(this, barcodeDetector).SetRequestedPreviewSize(700, 500).Build();

            cameraPreview.Holder.AddCallback(this);
            barcodeDetector.SetProcessor(this);
        }
Exemplo n.º 12
0
 protected override void OnCreate(Bundle bundle)
 {
     base.OnCreate(bundle);
     SetContentView(Resource.Layout.ScanLayout);
     mode = this.Intent.GetStringExtra("mode");
     InitActionBar();
     surfaceview = FindViewById <SurfaceView>(Resource.Id.surfaceView1);
     detector    = new BarcodeDetector.Builder(this)
                   .SetBarcodeFormats(BarcodeFormat.Ean13 | BarcodeFormat.Ean8 | BarcodeFormat.QrCode)
                   .Build();
     cSource = new CameraSource.Builder(this, detector)
               .SetRequestedPreviewSize(1000, 1000)
               .SetAutoFocusEnabled(true)
               .Build();
     surfaceview.Holder.AddCallback(this);
     detector.SetProcessor(this);
 }
Exemplo n.º 13
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);
            SetContentView(Resource.Layout.Register);

            cameraPreview = FindViewById <SurfaceView>(Resource.Id.cameraPreview);
            txtResult     = FindViewById <TextView>(Resource.Id.txtResult);

            barcodeDetector = new BarcodeDetector.Builder(this)
                              .SetBarcodeFormats(BarcodeFormat.QrCode)
                              .Build();
            cameraSource = new CameraSource
                           .Builder(this, barcodeDetector)
                           .SetAutoFocusEnabled(true)
                           .SetRequestedPreviewSize(1000, 1000)
                           .Build();

            cameraPreview.Holder.AddCallback(this);
            barcodeDetector.SetProcessor(this);
        }
        /*public async Task<string> ReadQRCode()
         * {
         *  await StartScanning();
         *  return result;
         * }*/
        #endregion

        public async Task StartScanning()
        {
            //cameraPreview = FindViewById<SurfaceView>(Resource.Id.cameraPreview);

            cameraPreview = new SurfaceView(this);
            SetContentView(cameraPreview);

            barcodeDetector = new BarcodeDetector.Builder(this)
                              .SetBarcodeFormats(BarcodeFormat.QrCode)
                              .Build();
            cameraSource = new CameraSource
                           .Builder(this, barcodeDetector)
                           .SetRequestedPreviewSize(640, 480)
                           .SetAutoFocusEnabled(true)
                           .Build();



            cameraPreview.Holder.AddCallback(this);
            barcodeDetector.SetProcessor(this);
        }
        private void Init()
        {
            mStartRequested   = false;
            mSurfaceAvailable = false;

            mAppIdProcessor = new BarcodeDetectorProcessor(this);

            mBarcodeDetector = new BarcodeDetector.Builder(Context)
                               .SetBarcodeFormats(BarcodeFormat.QrCode)
                               .Build();
            mBarcodeDetector.SetProcessor(mAppIdProcessor);

            mCameraBuilder = new CameraSource.Builder(Context, mBarcodeDetector)
                             .SetFacing(CameraFacing.Back)
                             .SetAutoFocusEnabled(true)
                             .SetRequestedFps(30.0f);

            mSurfaceView = new SurfaceView(Context);
            mSurfaceView.Holder.AddCallback(new SurfaceCallback(this));
            AddView(mSurfaceView);
        }
Exemplo n.º 16
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);
            SetContentView(Resource.Layout.googlescanlayout);

            cameraview = FindViewById <SurfaceView>(Resource.Id.cameraPreview);
            txtresult  = FindViewById <TextView>(Resource.Id.txtresultview);

            barcodeDetector = new BarcodeDetector.Builder(this)
                              .SetBarcodeFormats(BarcodeFormat.QrCode)
                              .Build();
            cameraSource = new CameraSource
                           .Builder(this, barcodeDetector)
                           .SetRequestedPreviewSize(640, 480)
                           .SetAutoFocusEnabled(true) //----
                           .Build();
            // Create your application here

            cameraview.Holder.AddCallback(this);
            barcodeDetector.SetProcessor(this);
        }
Exemplo n.º 17
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);
            // Set our view from the "main" layout resource
            // SetContentView(Resource.Layout.QrCode);
            surfaceView = FindViewById <SurfaceView>(Resource.Id.cameraView);
            txtResult   = FindViewById <TextView>(Resource.Id.txtResult);
            Bitmap bitMap = BitmapFactory.DecodeResource(ApplicationContext
                                                         .Resources, Resource.Drawable.logo_3m);

            barcodeDetector = new BarcodeDetector.Builder(this)
                              .SetBarcodeFormats(BarcodeFormat.QrCode)
                              .Build();
            cameraSource = new CameraSource
                           .Builder(this, barcodeDetector)
                           .SetRequestedPreviewSize(1600, 1024)
                           .SetAutoFocusEnabled(true)
                           .SetRequestedFps(24.0f)
                           .Build();
            surfaceView.Holder.AddCallback(this);
            barcodeDetector.SetProcessor(this);
        }
Exemplo n.º 18
0
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);
            SetContentView(Resource.Layout.Main);

            cameraPreview = FindViewById <SurfaceView>(Resource.Id.cameraPreview);
            txtResult     = FindViewById <TextView>(Resource.Id.txtResult);

            barcodeDetector = new BarcodeDetector.Builder(this)
                              .SetBarcodeFormats(BarcodeFormat.QrCode)
                              .Build();
            cameraSource = new CameraSource
                           .Builder(this, barcodeDetector)
                           .SetRequestedPreviewSize(1280, 720)
                           .SetRequestedFps(30.0f)
                           .SetAutoFocusEnabled(true)
                           .Build();

            cameraPreview.Holder.AddCallback(this);
            cameraPreview.SetOnClickListener(this);
            barcodeDetector.SetProcessor(this);
        }
        protected override void OnElementChanged(ElementChangedEventArgs <Xamarin.Forms.View> e)
        {
            base.OnElementChanged(e);

            try
            {
                if (e.OldElement != null || Element == null)
                {
                    return;
                }

                var activity = this.Context as Activity;
                _View = activity.LayoutInflater.Inflate(Resource.Layout.BarcodeScanView, this, false);
                AddView(_View);

                _SurfaceView = FindViewById <SurfaceView>(Resource.Id.barcodeScanView);

                var view = (BarcodeScanView)this.Element;
                _BarcodeDetector = new BarcodeDetector.Builder(this.Context)
                                   .SetBarcodeFormats(XamBarcodeFormatToAndroid(view.BarcodeFormat))
                                   .Build();

                _CameraSource = new CameraSource
                                .Builder(this.Context, _BarcodeDetector)
                                .SetFacing(CameraFacing.Back)       //default to back
                                .SetAutoFocusEnabled(true)          //default to false
                                .SetRequestedPreviewSize(1024, 768) //default to 1024x768
                                .SetRequestedFps(30f)               //default to 30 fps
                                .Build();

                _SurfaceView.Holder.AddCallback(this);
                _BarcodeDetector.SetProcessor(this);
            }
            catch (Exception ex)
            {
                Console.WriteLine("DROID_SCAN | OnElementChanged error", ex);
            }
        }
        public BarCodeCameraPreview(Context context) : base(context)
        {
            windowManager = Context.GetSystemService(Context.WindowService).JavaCast <IWindowManager>();

            barcodeDetector = new BarcodeDetector.Builder(context)
                              .SetBarcodeFormats(BarCodeCamera.BarcodeFormats)
                              .Build();

            cameraSource = new CameraSource
                           .Builder(context, barcodeDetector)
                           //.SetRequestedPreviewSize(1024, 768)
                           .SetAutoFocusEnabled(true)
                           .SetRequestedFps(30.0f)
                           .Build();

            surfaceView = new SurfaceView(context);
            surfaceView.Holder.AddCallback(new BarcodeSurfaceHolderCallback(cameraSource, surfaceView, this));
            AddView(surfaceView);

            barcodeDetectorProcessor             = new BarCodeDetectorProcessor(context, cameraSource);
            barcodeDetectorProcessor.OnDetected += DetectProcessor_OnDetected;
            barcodeDetector.SetProcessor(barcodeDetectorProcessor);
        }
Exemplo n.º 21
0
        public CameraPreview(Context context)
            : base(context)
        {
            windowManager   = Context.GetSystemService(Context.WindowService).JavaCast <IWindowManager>();
            barcodeDetector = new BarcodeDetector.Builder(context)
                              .SetBarcodeFormats(Configuration.BarcodeFormats)
                              .Build();
            cameraSource = new CameraSource
                           .Builder(context, barcodeDetector)
                           .SetRequestedPreviewSize(640, 480)
                           .SetAutoFocusEnabled(true)
                           .Build();
            Configuration.CameraSource = cameraSource;
            surfaceView = new SurfaceView(context);

            surfaceView.Holder.AddCallback(new SurfaceHolderCallback(cameraSource, surfaceView));
            AddView(surfaceView);

            var detectProcessor = new DetectorProcessor(context);

            detectProcessor.OnDetected += DetectProcessor_OnDetected;
            barcodeDetector.SetProcessor(detectProcessor);
        }
 public void Release()
 {
     barcodeDetector.SetProcessor(null);
 }
        public void ReceiveDetections(Detections detections)
        {
            var codes = detections.DetectedItems;

            if (codes.Size() == 0)
            {
                return;
            }

            if (Task != null)
            {
                if (Task.IsCanceled)
                {
                    Task = null;
                    RunOnUiThread(() =>
                    {
                        ShowToastMessage("Task.IsCanceled", ToastLength.Long);
                    });
                    Thread.Sleep(5000);
                    return;
                }
                if (Task.IsFaulted)
                {
                    Task = null;
                    RunOnUiThread(() =>
                    {
                        ShowToastMessage("Task.IsFaulted", ToastLength.Long);
                    });
                    Thread.Sleep(5000);
                    return;
                }
                if (Task.IsCompletedSuccessfully)
                {
                    Task = null;
                    RunOnUiThread(() =>
                    {
                        ShowToastMessage("Task.IsCompletedSuccessfully", ToastLength.Long);
                    });
                    Thread.Sleep(5000);
                    return;
                }
                if (Task.IsCompleted)
                {
                    Task = null;
                    RunOnUiThread(() =>
                    {
                        ShowToastMessage("Task.IsCompleted", ToastLength.Long);
                    });
                    Thread.Sleep(5000);
                    return;
                }

                ShowToastMessage(Task.Status.ToString());
                Thread.Sleep(5000);
                return;
            }

            BarcodeDetector.Release();
            var barcode = (Barcode)codes.ValueAt(0);

            _scannedBarcode = barcode.RawValue;
            CameraPreviewProgressBar.Visibility = ViewStates.Visible;

            RunOnUiThread(() =>
            {
                ShowToastMessage(_scannedBarcode, ToastLength.Long);
            });

            Thread.Sleep(5000);
            if (!_callback)
            {
                Task = Task.Run(async() =>
                {
                    try
                    {
                        var result = await ProductService.GetProductByBarcode(_scannedBarcode);

                        if (result.Error.Any())
                        {
                            var message = Resources.GetString(Resource.String.ProductBarcodeNotFound);

                            RunOnUiThread(() =>
                            {
                                BarcodeDetector.SetProcessor(this);
                                ShowToastMessage(message, ToastLength.Long);
                            });

                            return;
                        }

                        RunOnUiThread(() =>
                        {
                            NavigationManager.GoToProductDetails(result.Data);
                        });
                    }
                    catch (Exception ex)
                    {
                        RunOnUiThread(() =>
                        {
                            BarcodeDetector.SetProcessor(this);
                            ShowToastMessage(ex.Message, ToastLength.Long);
                        });
                    }
                });
            }
            else
            {
                NavigationManager.GoToPrevious();
            }
        }
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);
            SetContentView(Resource.Layout.scanner);



            //mysql-------------------------------------

            sServer = "Server=projektowanie.vetrex.eu;Port=3306;database=UG;User Id=UG;Password=WinterIsComing0;charset=utf8";
            SetMysqlConn(sServer);
            //------------------------------------------


            cameraPreview = FindViewById <SurfaceView>(Resource.Id.cameraPreview);
            txtResult     = FindViewById <TextView>(Resource.Id.txtResult);
            ListDataPos   = FindViewById <ListView>(Resource.Id.lvListLog);
            btnApproved   = FindViewById <Button>(Resource.Id.btnApproved);


            logList = new List <string>();

            vib = (Vibrator)GetSystemService(Context.VibratorService);



            barcodeDetector = new BarcodeDetector.Builder(this)
                              .SetBarcodeFormats(BarcodeFormat.Ean13)
                              .Build();

            cameraSource = new CameraSource
                           .Builder(this, barcodeDetector)
                           .SetRequestedPreviewSize(640, 480)
                           .SetAutoFocusEnabled(true)
                           .Build();



            cameraPreview.Holder.AddCallback(this);
            barcodeDetector.SetProcessor(this);

            Android.Support.V7.Widget.Toolbar toolbar = FindViewById <Android.Support.V7.Widget.Toolbar>(Resource.Id.toolbar);


            // On Click delegate
            btnApproved.Click += delegate
            {
                OnButtonApprovedClicked();
            };

            void OnButtonApprovedClicked()
            {
                var intent = new Intent(this, typeof(AddMealActivity));

                intent.PutExtra("kcalInput", kcalInput);
                intent.PutExtra("carbInput", carbInput);
                intent.PutExtra("fatInput", fatInput);
                intent.PutExtra("proteinInput", proteinInput);
                StartActivity(intent);
                Finish();
            }
        }