0 Replies Latest reply on Apr 11, 2019 6:36 AM by Lorenzo berti

    scanner.enable() trhow ScannerException

    Lorenzo berti

      Hello,
      In my app for Zebra MC330M I use EMDK: Zebra Technologies Corp:EMDK APIs:26

       

      I have a activity that implements listener and I override onOpened function:

       

       

      @Override
      public void onOpened(EMDKManager emdkManager) {

          this.emdkManager = emdkManager;
          try {

             initializeScanner();
           } catch (ScannerException e) {

              Log.e("ON_OPENED", e.getMessage());
              e.printStackTrace();
           }

      }

       

      And as documentation said in Link: Basic Scanning Tutorial using Barcode API - Zebra Technologies Techdocs

       

      I put in the initializeScanner function:

      if (scanner == null) {

         // Get the Barcode Manager object
         barcodeManager = (BarcodeManager) emdkManager.getInstance(FEATURE_TYPE.BARCODE);
         // Add connection listener
         if (barcodeManager != null) {

         barcodeManager.addConnectionListener(this);
         }

         // Get default scanner defined on the device
         scanner = barcodeManager.getDevice(BarcodeManager.DeviceIdentifier.DEFAULT);
         // Add data and status listeners
         scanner.addDataListener(this);
         scanner.addStatusListener(this);
         // Hard trigger. When this mode is set, the user has to manually
        // press the trigger on the device after issuing the read call.
         scanner.triggerType = TriggerType.HARD;
         // Enable the scanner
         scanner.enable();
         startRead = true;

         }

       

      But when call scanner.enable() it throws ScannerException exception with message:

       

      "Failure"