Adding the EMDK Xamarin component to Visual Studio 2017

Anonymous (not verified) -
4 MIN READ
75
4

Updated 6th March 2018:

Zebra has now released EMDK for Xamarin as a Nuget package (currently a beta release of version 2.7): EMDK For Xamarin Nuget Install [BETA] - Zebra Technologies TechDocs .  You should only follow the steps in this post if you require EMDK for Xamarin support at a specific version in Visual Studio 2017

Original post:

Microsoft recently announced that they are closing down the Xamarin component store and encouraging developers to move to NuGet to include 3rd party packages in their applications, as part of that effort the Xamarin Component store is only visible to projects which currently use Xamarin components in their applications.

This is a problem for EMDK for Xamarin developers on Zebra devices creating new applications since the EMDK for Xamarin is currently only available as a component.

The team are working to release EMDK for Xamarin as a NuGet package but in the meantime, here are your options for getting EMDK for Xamarin working with Visual Studio 2017

Creating a greenfield application

Starting from scratch and following the EMDK for Xamarin setup guide you will encounter difficulties following the second step which details how to ‘Install the Xamarin Component’, you are instructed to “Right click on the Project’s Component folder in the Solution Explorer” which is not possible in VS2017 since Microsoft have removed the ‘Component’ folder.

Instead:

  • Create your Xamarin application as you would for any new Xamarin app
  • Install the EMDK Visual Studio extension, this is step 1 in the EMDK for Xamarin setup guide and has not changed.  A word of warning, the documentation does not seem to have been updated to take account of the introduction of Visual Studio for Mac.
  • Here is the bit that is different from earlier versions of Visual Studio: To add the Xamarin component to your project you need to manually edit the .csproj for your project:
    • Copy the contents of the Components zip file attached to this post to the root of your Visual Studio Solution, so it is at the same level as your .sln file and the folder above your .csproj file.
    • Edit your .csproj file to add the following reference (shown in context):
 
   
False   
..\Components\emdk-component-2.6.0.70\lib\android\Symbol.XamarinEMDK.dll 

(You may need to edit the version numbers to match the version of EMDK for Xamarin you are installing)

    • Edit your .csproj file to add the following reference (shown in context):
 
  
     
False      
2.6.0.70   
 
  • Reload your project within your Visual Studio solution

  You will now have the EMDK for Xamarin component installed in your project as well as access to the Symbol.XamarinEMDK namespace.

3.png

Applications built from our EMDK Samples

Many people (including myself) prefer to start from a known, working Sample.  EMDK for Xamarin samples are listed on our techdocs support site (http://techdocs.zebra.com/emdk-for-xamarin/2-6/samples/) and because they already have a Xamarin component installed, you do not have to edit the .csproj file.  You might want to update the version of the Xamarin component installed in the sample so these instructions cover that scenario:

git clone https://github.com/Zebra/samples-emdkforxamarin-2_5.git 
cd samples-emdkforxamarin-2_5 git
checkout ProfileWifiSample1
  • Open the solution (I had to install API level 19 as I did not yet have that installed, Tools --> Android --> Android SDK Manager)
  • Follow the instructions at the docs site but for completeness I’ll also list the key steps here:
    • Click EMDK from the Visual Studio menu and then ‘Add Xamarin Component’.  This will add the Xamarin component to your local machine in the following location but will NOT add the Xamarin component to your project:
Windows: %LocalAppData%\Xamarin\Cache\Components 
Mac: ~/Library/Caches/Xamarin/Components

menu-install.jpg

    • Right click on the Components option then ‘Edit Components’.  You should see EMDK For Xamarin installed on your machine.  To replace the version in the sample (which may be old) just click ‘Remove’, then ‘Add to Project’ for the newer version.
      • When I did this I got an error saying I must be logged-in to download this component, as detailed in the current Zebra docs.  I then got a 503 error from Xamarin but the component appears to have installed correctly.  You can check this by observing the version of EMDK for Xamarin if you double-click on the component

4.png

The sample application, after clicking 'Edit Components'

5.png

The sample application, after updating to the latest component.

Bear in mind that once the EMDK for Xamarin NuGet component is available, these instructions no longer apply.

profile

Anonymous (not verified)

Please Register or Login to post a reply

4 Replies

J Justin Rogers

Now that the NuGet package is available, how are we to access the Profile Manager?  In the past it was accessible via the toolbar menu option that came as a result of the EMDK Xamarin component but with the transition to the NuGet package that's no longer viable.

Regards,
Justin

r roberto cottone

Hi, the Profile Manager is still provided by a Visual Studio Extension and this process remains unchanged (instructions for <a href="http://techdocs.zebra.com/emdk-for-xamarin/2-7/guide/vs/setup/">Windows…; and <a href="http://techdocs.zebra.com/emdk-for-xamarin/2-7/guide/xs/setup/">Mac</a&…;), For VS2017 it is this extension: <a href="https://marketplace.visualstudio.com/items?itemName=EmdkForXamarin.EMDK… for Xamarin - Visual Studio Marketplace</a>​

If the extension makes any reference to 'add Xamarin component', ignore that menu option and add Xamarin through Nuget

J Justin Rogers

Thanks for the prompt response!

P Pablo Iglesias

Hi,

Six months and (at least) two new versions of the Xamarin Component later, and the NuGet repository still has the 2.7.0.76 <strong>RC</strong> version.

Are you no longer maintaining the Xamarin Component? Also the published RC version has some critical bugs which are resolved in version 2.7.0.78, at least to my knowledge.

Do you plan to update the version published in NuGet? Must we continue to update the component in a way that is <strong>no longer supported</strong>?