EMDK in Xamarin Android -- no Components folder

T Thomas Kopp 3 years 8 months ago
38 2 0

I've installed the latest EMDK on my computer, v2.6.0.70 according to the "About EMDK" in the EMDK menu item in my Visual Studio.  I'm running Visual Studio 2017 and created ab Android project.  The instructions for installing the Xamarin EMDK, according to this
 
Xamarin Component Install - Zebra Technologies TechDocs
 
tell me to select EMDK->Add Xamarin Component from the Visual Studio menu, which I can do successfully.  The instructions then tell me that I'll have to install the component in my project.  My project does not have a Components folder.  According to this
 
Hello NuGet! A New Home for Xamarin Components | Xamarin Blog
 
Visual Studio no longer has Components.  But your sample application (emdk-component-2.6.0.69\samples\BarcodeSample1 from the zip file) has a Components folder.  Am I missing something?  I tried just adding a reference to the Symbol.XamarinEMDK.dll in my project but as soon as I add ", EMDKManager.IEMDKListener" to the end of an Activity class declaration, that activity throws an exception when it's started.

Please Register or Login to post a reply

2 Replies

r roberto cottone

Hi,

The team are working on moving EMDK for Xamarin to Nuget as a priority.

As a workaround, Visual Studio will still offer you the component store if your project has an existing component.  You can manually add the component by editing the .csproj file:
Using samples-emdkforxamarin-2_5/BarcodeSample1 at BarcodeSample1 · Zebra/samples-emdkforxamarin-2_5 · GitHub  as a reference:

Copy  the samples-emdkforxamarin-2_5/BarcodeSample1/Components at BarcodeSample1 · Zebra/samples-emdkforxamarin-2_5 · GitHub  folder to the equivalent place in your project.
Add this reference to Symbol.XamarinEMDK: samples-emdkforxamarin-2_5/BarcodeSample1.csproj at BarcodeSample1 · Zebra/samples-emdkforxamarin-2_5 · GitHub
Add this item group for Xamarin components: samples-emdkforxamarin-2_5/BarcodeSample1.csproj at BarcodeSample1 · Zebra/samples-emdkforxamarin-2_5 · GitHub

Not ideal I know but it will work for a new project with the latest version of VS2017.  Alternatively you can just use samples-emdkforxamarin-2_5/BarcodeSample1/BarcodeSample1 at BarcodeSample1 · Zebra/samples-emdkforxamarin-2_5 · GitHub  or one of our other sample apps as the starting point for your application.

Hope that helps.

T Thomas Kopp

Hi Darryn:

Thanks, that's what I'd ended up doing before I saw your reply.  However, I am still unable to scan, however.

I downloaded the sample from:

samples-emdkforxamarin-2_5/BarcodeSample1/BarcodeSample1 at BarcodeSample1 · Zebra/samples-emdkforxamarin-2_5 · GitHub

and was able to get it to run, but it does not respond to trigger presses and the UI keeps refreshing.  I also tried creating a new project (blank Android) and copied the code from:

Basic Scanning Tutorial using Barcode API - Zebra Technologies TechDocs

into it and got the same behaviour.  I'm in windows 10, running Visual Studio 2017.  I'm using the MC3300, which has Android 7.1.2.  I've tried the EMDK For Xamarin 2.5 component, as well as the EMDK For Xamarin 2.6.0.69 and 2.6.0.70 components.

I see that the MC330 is listed as tested with the EMDK 2.7 on this page:

EMDK For Xamarin - Zebra Technologies TechDocs

but none of the samples at:

Samples - Zebra Technologies TechDocs

list the MC3300.  Also, all the Sample download links and zips point to version 2.5 in GitHub.

When I run any of the sample/tutorial apps, what will happen is that the UI will continuously refresh, and most of the time the trigger will not activate the scanner.  Occasionally it does, and the device beeps, but the scanner_Data callback is never hit.  I've tried taking out all UI update code, but it still rarely triggers the laser and never hits the data callback.

I thought maybe it was a hardware issue, but the DWDemo app that came pre-installed works correctly.  If I can use Intents sent from DataWedge in Xamarin C#, I'll do it that way if I have to.  I don't know if there's some detail I'm missing with the EMDK, but I've tried several versions of the barcode sample and the barcode tutorial and have not yet been successful.

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