Hello All, I had already created an Android app to run on the MC67NA which previously was only shipped with Jelly Bean. Because the EMDK only supported KitKat and above, I had to do all barcode scanning via DataWedge. However, now that KitKat has been released and I now have a device running KitKat, I am modifying the app to use the EMDK instead of DataWedge. My question is, while I see all the samples provided and they do help get started, they are also geared towards a single layout/Activity application. My existing application has a main Activity which serves as a container for fragments and a view pager. I need to do scanning on several of the fragments when they are the active page in the view pager. The DataWedge made this easy because I didn't have to worry about any of that, it would just scan to the field which had focus.
All that said, what is the best way to implement the EMDK barcode scanner for this setup? I know many people are against a singleton class, but I was thinking about going down this road. Create a singleton to implement the scanner when the app starts up. From each fragment, I could then get the instance to the scanner class and use it. Can anybody give me some advice on this? I also don't know how exactly to also register the event handlers in the singleton (assuming this is the best method) and then have those events fire on the fragments.
I do want to get away from DataWedge and integrate the EMDK for various reasons.
Last, on a related note, I have started to code this approach and am getting an exception on this line:
EMDKResults results = EMDKManager.GetEMDKManager(Application.Context, this);
The exception states:
Java.Lang.ClassNotFoundException: Didn't find class "com.symbol.emdk.EMDKManager" on path: DexPathList[[zip file "/data/app/PocketPacTracAndroid.PocketPacTracAndroid-2.apk"],nativeLibraryDirectories=[/data/app-lib/PocketPacTracAndroid.PocketPacTracAndroid-2, /vendor/lib, /system/lib]]
This happens even though I have included the reference:
Thanks in advance!
Message was edited by: Michael Bedford I wanted to edit my post, it is my own fault for not posting the whole code and if I had, I think you all would have seen my issue. I missed this one completely, however, wanted to update this thread in case anybody else has the same issue. The problem with the exception is I did not include the following lines in my manifest. So note, not including these lines will cause the error I indicated above:
1. In the <application></application> tags, you must have this line: <uses-library android:name="com.symbol.emdk" />
2. Just under the uses-sdk tag, you must have this line: <uses-permission android:name="com.symbol.emdk.permission.EMDK" />