I am trying to do an application on Xamarin Android and wanted to integrate Motorola EMDK Barcode Scan with it. Please let me know, if in case anyone have already invented this wheel. Please help me as I am on a tight deadline.
I got the Android EMDK release 3 on my MC40 to finally initialize the emdkmanager after some fiddling. For the bindings library I had to add :
<remove-node path="/api/package[@name='com.symbol.emdk.barcode']/interface[@name='BarcodeManager.ScannerConnectionListener']" />
to the metadata.xml file. You also have to add the following permissions to the android manifest in your application:
<uses-permission android:name="com.symbol.emdk.permission.EMDK" />
<uses-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="android.permission.VIBRATE" />
<uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW" />
and also the following library uses or you might find that you are calling stubbed methods and not the full com.symbol.emdk library that should be installed on the motorola unit.
<uses-library android:name="com.symbol.emdk" />
<uses-library android:name="com.motorolasolutions.scanner" />
<uses-library android:name="com.motorolasolutions.adc.usbscanner" android:required="false" />
I've attached the bindings dll to save a step.
Due to a request I'm adding a sample project that works for me for using the motorola mc40 scanner (or any emdk 3 supported scanner) in Xamarin. I noticed on my previous try that ScannerConfig class didn't get converted properly so I just wrote a simplified proxy class in java with Eclipse to handle initialization and enabling of the scanner. I still need to expose some more of the configuration parameters on my proxy class but it currently does 99% of what I need it to do. Note: Any object that implements IProxyDataListener to receive the scan should also inherit Java.Lang.Object.
I am using Motorola MC 40 for the development.
Thanks in advance
There are 2 approaches:
here is the sample barcode scanner I have created using Zxing in Xamarin.Forms: https://github.com/kirtisagar/BarcodeScanner-Xamarin.Forms try to run this in your device.
I hope this helps.
Thanks for the reply. I checked the Zxing library. But my initial look says it will work only with Xamarin Forms. Unfortunately we dont use forms for our development.
@kirti, Can you please validate my understanding?
@bijoy, The sample which I created is on Xamarin.Forms. Download the Zxing component, it has Native android sample.
Il curious about the installing of the EMDK package,
I need it to use the Scanner of a Motorola TC 55
I'm working with Xamarin
When I try to run the EMDK Installer, it says that there is no valid ADT root path
I've tryied my Android path
Also the Android/Tool path
Does anyone know how I can install that EMDK to use with Xamarin (not eclipse)
Thanks for any help
You have to use the Android SDK path. For me it was C:\Program Files (x86)\Android\android-sdk\
And even if I am using Xamarin I had to add Eclipse because the EMDK installation wants the path.
Hope that helped.
Finaly I didn't had to install EMDK
I'm using this example that does not requires EMDK installed on the Host Machine
Hi @EricHamrick , where is the sample project? I need to be able to change (or at least read) the settings of the default profile in DataWedge app.
@EricHamrick I would like to have the sample too.
Updated link for the solution to use Data Wedge method
I am using Xamarin.Forms and need to scan the bar code for motorola TC70 Device. I have intergrated the EMDK in Droid project and get the scanner value in scanner_Data method. When I press the scan button in the device it successfully triggers the scanner_Data event but the problem is How can i get this event in my PCL Xaml Forms. So that i will know the scanner button is pressed and xxx data is scanned. I used dependency injection by creating an interface in the PCL project and implement it on Droid project. But not able to get the object of class in PCL project Xaml Form. I use this line of code to get the object of implementation class.
var currentLocationService = Xamarin.Forms.DependencyService.Get();
//It gives me error like Default Constructor is not defined
currentLocationService.positionChanged += OnDataScanned;
//OnDataScanned: this is the method where i need to have return in xaml form.
//PositionEventArgs is in my class
private void OnDataScanned(object sender, PositionEventArgs e)
//Debug.WriteLine("Got the update in ContentPage from service ");
//CurrentLocationService is my interface contains in same PCL project and implementation of this interface is in the Droid Project.
Please help! Thanks in Advance! Please try to give the step by step solution.
do you have to send your barcode to PCL project? Use MessagingCenter
Xamarin Inc., as a wholly-owned Microsoft subsidiary acting as a separate legal entity, adheres to the Microsoft Privacy Statement: Privacy & cookies