0 Replies Latest reply on Sep 12, 2016 9:33 AM by Antonio Coentrao

    Using wrapper class in android studio

    Antonio Coentrao

      I've implemented a wrapper class according to this guide for the barcode functionality and when I try to use this wrapper class in my activity I get a nullpointerexception for the barcodeManager. When debugging I verify that the OnOpened method of the EMDKListener interface is not being called. Any hint? Here is the partial code for the wrapper class:


      public class ZebraBarcode implements EMDKListener, DataListener, StatusListener{


          private Context mContext=null;

          private EMDKManager mEmdkManager=null;

          private BarcodeManager mBarcodeManager=null;

          private Scanner mScanner=null;

          private ScanDataCollection mScanDataCollection=null;

          private StatusData mStatusData=null;


          public ZebraBarcode(Context context){




          public boolean getEMDKManager(){

              boolean bManager=true;

              EMDKResults results = EMDKManager.getEMDKManager(mContext, this);

              if(results.statusCode != EMDKResults.STATUS_CODE.SUCCESS){



              return bManager;




          public void onOpened(EMDKManager emdkManager) {




      In my activity I call this class:


      if(Build.MANUFACTURER.contains("Zebra Technologies")

        || Build.MANUFACTURER.contains("Motorola Solutions")){

         mBarcodeSystem = new ZebraBarcode(mContext);