Handling multiple EMDK versions

C Charles Berlin 2 years 11 months ago
4 1 0

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.

Please register or login to post a reply

1 Replies

V Vedsatx Saddvv

Hi, I'm not sure you will be able to chose the jar file dynamically at runtime.  A while ago I published a post describing how to use build flavours to use different versions of the emdk at build time: .  I know you would rather have a runtime solution but I hope that post helps.

CONTACT
Can’t find what you’re looking for?