Ejemplo n.º 1
0
        public void OnOpened(EMDKManager emdkManager)
        {
            mEmdkManager = emdkManager;

            if (null == mScanner)
            {
                // Get Barcode Manager
                mBarcodeManager = (BarcodeManager)mEmdkManager.GetInstance(EMDKManager.FEATURE_TYPE.Barcode);
                if (null == mBarcodeManager)
                {
                    mStatusTextView.Text = "Impossible to get BarcodeManager handle";
                    return;
                }
                mScanner = mBarcodeManager.GetDevice(BarcodeManager.DeviceIdentifier.InternalImager1);

                if (null == mScanner)
                {
                    mStatusTextView.Text = "Impossible to get Scanner handle";
                    return;
                }

                try
                {
                    mScanner.AddDataListener(this);
                    mScanner.AddStatusListener(this);

                    mScanner.TriggerType = Scanner.TriggerTypes.Hard;

                    mScanner.Enable();

                    mScanner.Read(); // Start an Async scann
                }
                catch (ScannerException e)
                {
                    e.PrintStackTrace();
                }

                Toast.MakeText(this, "Press Hard Scan Button to start scanning...", ToastLength.Long).Show();
            }
        }
Ejemplo n.º 2
0
        public void OnOpened(EMDKManager emdkManager)
        {
            mEmdkManager = emdkManager;

            if (null == mScanner)
            {
                // Get Barcode Manager
                mBarcodeManager = (BarcodeManager)mEmdkManager.GetInstance(EMDKManager.FEATURE_TYPE.Barcode);
                if (null == mBarcodeManager)
                {
                    mStatusTextView.Text = "Impossible to get BarcodeManager handle";
                    return;
                }
                mScanner = mBarcodeManager.GetDevice(BarcodeManager.DeviceIdentifier.InternalImager1);

                if (null == mScanner)
                {
                    mStatusTextView.Text = "Impossible to get Scanner handle";
                    return;
                }

                try
                {
                    mScanner.AddDataListener(this);
                    mScanner.AddStatusListener(this);

                    mScanner.TriggerType = Scanner.TriggerTypes.Hard;

                    mScanner.Enable();

                    mScanner.Read(); // Start an Async scann
                }
                catch (ScannerException e)
                {
                    e.PrintStackTrace();
                }

                Toast.MakeText(this, "Press Hard Scan Button to start scanning...", ToastLength.Long).Show();
            }
        }