1 Reply Latest reply on Nov 15, 2018 8:39 AM by Darryn Campbell

    Handling multiple EMDK versions

    Joseph Nicolia

      When our app encounters a device with an old version of the emdk (less than 4) our application throws a Fatal Exception: java.lang.VerifyError exception and the app crashes.  The crash happens on this line

       

      EMDKResults results = EMDKManager.getEMDKManager(context, setUpEmdkListener(reset));
      

       

      Currently we are in control of our fleet of devices and can simply upgrade that device to have a more current version of the EMDK and all is well.  Moving forward I'd like to be able to handle this more gracefully and also design the app to work regardless of the device emdk version.  I was wondering if this was possible and how I'd go about doing it.  I'm thinking about using something like this to determine the version

      try {   
         String emdkPkgName = "com.symbol.emdk.emdkservice";
         PackageInfo pinfo = getPackageManager().getPackageInfo(emdkPkgName, 0);
         String emdkVersion = pinfo.versionName;
      } catch (PackageManager.NameNotFoundException e) {
         // EMDK does not exists on the device.
      }
      
      
      
      
      

      And then having the application have several versions of the emdk sdk (jar file?) and load the appropriate one.  Is this possible?  Any help would be appreciated because in the near future we will not be able to guarantee what version of the emdk is on a device and we will need to handle this case in some fashion.