user2253812
user2253812

Reputation: 21

Would like to use ZEBRA EMDK on Mobile phones (samsung S6) for barcode scanning purpose thru Camera as a scanner

1.I have added below line on manifest file

<uses-library android:name="com.symbol.emdk" android:required="false" />

2.I have added below dependency as per my directory path

dependencies {
provided fileTree(include: ['com.symbol.emdk.jar'], dir: 'C:\\Users\\<YOUR USER NAME>\\AppData\\Local\\Android\\sdk\\add-ons\\addon-symbol-emdk_v4.2_API-19\\libs')
compile fileTree(exclude: ['com.symbol.emdk.jar'], dir: 'libs')}
  1. I have added class "BarcodeScanEngine" as per the below Repo (https://gist.github.com/esquijarosa/1c79059c8833f922af945fa0719fad80)
  2. Now, the problem is when i'm creating object for BarcodeScanEngine on MainActivity class it is giving the runtime error as

java.lang.NoClassDefFoundError: com.sample.zebrascanengine.BarcodeScannerEngine ...

So, my question is am i doing something fundamentally wrong as in i shouldn't be using EDMK for mobile phones ? or am i missing something to get rid of the error ?

Upvotes: 2

Views: 909

Answers (1)

pfmaggi
pfmaggi

Reputation: 6486

Zebra's EMDK can only be used on Zebra devices.
It is possible to have an application that uses the EMDK running on a consumer device, like your Samsung S6, but only if you avoid to do any call to the EMDK library.

The idea is that your MainActivity needs to check if the EMDK library is available on the device and only at that point you instantiate the BarcodeScanEngine class.

You can find more information about this in Zebra's EMDK reference guide.

Disclaimer: I work for Zebra Technologies.

Upvotes: 3

Related Questions