6 Replies Latest reply on Aug 22, 2017 2:16 PM by Atin Agarwal

    RFD8500 Development using Xamarin

    Rick Elliott

      We just recently purchased the RFD8500 scanner for one of our production facilities to scan RFID tags on our production line.  We need to develop a small Android application to acquire the RFID information and send it to our system for use as we can't use the RFID scanning in the native browser on the Symbol Android device paired with it.  Since we're not a Java shop, we've been trying to use Xamarin to wrap the scanning SDK for consumption in a C# application.  However, so far our efforts haven't been successful - the SDK appears to return Success statuses on our calls to the various initialization and other functions, but we can't retrieve a list of the available scanners on the device.

       

      Does anyone know if Xamarin development is supported for use with the RFD8500 SDK?  If so, are there any examples available where it has been used that we could look at?  Any help would be appreciated.  Thanks.

        • Re: RFD8500 Development using Xamarin
          Pietro Francesco Maggi

          Hi Rick,

          we don't support officially Xamarin with the Scanner SDK for Android that is used for the RFD8500, however we've partner that have applications in production built using it.

           

          If your company is registered as an ISV with Zebra, you can request support (depending where are you based we've different support centers): Contact Tech Support

           

          Regarding your current test, have you built a xamarin binding for the Scanner SDK and it does not works as expected?

           

          ~Pietro

          1 of 1 people found this helpful
            • Re: RFD8500 Development using Xamarin
              Rick Elliott

              Hi Pietro.  Thanks for the reply.  I have reached out to Zebra Support and have a case number for the issue, but I haven't heard back from them yet.  For my current test, I did the following:

              • I created a Xamarin Bindings Library project to wrap the Scanner SDK Android Archive Library.  I didn't receive any errors from compilation, so my assumption was that there were no conversions, etc. that I needed to do.
              • My test app is trying to do the bare minimum test -- basically initialize the SDK and try to connect to the scanner.
              • I get success result codes back from the SDK functions that I'm calling, and I have followed the calls down into the wrapper functions to make sure I'm not getting false positives. From all appearances, it seems to be calling the underlying SDK functions without issues and reporting a success status.
              • My problem is that I can't retrieve a list of available scanners from the SDK, it always returns a blank list.  I have tried this on a couple different Android devices.  In each case, I have the scanner paired with the device through the Bluetooth settings.  If I try the Zebra RFID Mobile application from the Play Store on each device, I can see the scanner listed in the Readers List, as well as connect to it, scan, disconnect, etc.  So that tells me the scanner is properly paired with each device.  However, when I try my test application, I can't see any available scanners, no matter what I try... I always get an empty list back showing zero scanners.  This seems to point to either a problem in the binding that I'm not aware of or in the code that I'm trying to use to access the scanner.

               

              I followed the SDK documentation in the way that I coded it and have been back over it several times to see if I'm doing something wrong, but at this point I can't find it.  I've also been through the Zebra Demo app Java code trying to see how it does the communication but it seems similar to what I'm doing (I could be missing something as I'm not a Java expert).

               

              Here's the OnCreate method (with debug messages) from my activity where I'm doing all the work in case you're interested.  If you have any other thoughts, I'd be happy to hear them.   Thanks again for the reply.

               

              protected override void OnCreate(Bundle bundle)

              {

                  base.OnCreate(bundle);

               

                  // Set our view from the "main" layout resource

                  SetContentView(Resource.Layout.Main);

               

                  _debug = FindViewById<EditText>(Resource.Id.debugMessage);

               

                  // Setup this class as SDK handler and delegate for events

                  _sdkHandler = new SDKHandler(this);

                  var result = _sdkHandler.DcssdkSetDelegate(this);

               

                  if (result == DCSSDKDefs.DCSSDK_RESULT.DcssdkResultSuccess)

                      ShowMessage("Delegate Setup Successful");

                  else

                      ShowMessage("Delegate Setup Failed -- result: " + result.ToString());

               

                  // Setup event notifications

                  int notifyMask = DCSSDKDefs.DCSSDK_EVENT.DcssdkEventScannerAppearance.Value | DCSSDKDefs.DCSSDK_EVENT.DcssdkEventScannerDisappearance.Value |

                      DCSSDKDefs.DCSSDK_EVENT.DcssdkEventSessionEstablishment.Value | DCSSDKDefs.DCSSDK_EVENT.DcssdkEventSessionTermination.Value |

                      DCSSDKDefs.DCSSDK_EVENT.DcssdkEventBarcode.Value;

               

                  // Enable scanner detection

                  result = _sdkHandler.DcssdkSetOperationalMode(DCSSDKDefs.DCSSDK_MODE.DcssdkOpmodeBtNormal);

               

                  if (result == DCSSDKDefs.DCSSDK_RESULT.DcssdkResultSuccess)

                      ShowMessage("Set Operational Mode Successful");

                  else

                      ShowMessage("Set Operational Mode Failed -- result: " + result.ToString());

               

                  result = _sdkHandler.DcssdkEnableAvailableScannersDetection(true);

               

                  if (result == DCSSDKDefs.DCSSDK_RESULT.DcssdkResultSuccess)

                      ShowMessage("Enable Available Scanners Detection Successful");

                  else

                      ShowMessage("Enable Available Scanners Detection Failed -- result: " + result.ToString());

               

                  result = _sdkHandler.DcssdkSubsribeForEvents(notifyMask);

               

                  if (result == DCSSDKDefs.DCSSDK_RESULT.DcssdkResultSuccess)

                      ShowMessage("Subscribe For Events Successful");

                  else

                      ShowMessage("Subscribe For Events Failed -- result: " + result.ToString());

               

                  List<DCSScannerInfo> scanners = new List<DCSScannerInfo>();

                  result = _sdkHandler.DcssdkGetAvailableScannersList(scanners);

               

                  if (result == DCSSDKDefs.DCSSDK_RESULT.DcssdkResultSuccess)

                      ShowMessage("Get Available Scanners List Successful");

                  else

                      ShowMessage("Get Available Scanners List Failed -- result: " + result.ToString());

               

                  ShowMessage(string.Format("Scanners Detected: {0}", scanners.Count));

               

                  result = _sdkHandler.DcssdkGetActiveScannersList(scanners);

               

                  if (result == DCSSDKDefs.DCSSDK_RESULT.DcssdkResultSuccess)

                      ShowMessage("Get Active Scanners List Successful");

                  else

                      ShowMessage("Get Active Scanners List Failed -- result: " + result.ToString());

               

                  ShowMessage(string.Format("Scanners Detected: {0}", scanners.Count));

               

                  if (scanners.Count > 0)

                  {

                      result = _sdkHandler.DcssdkEstablishCommunicationSession(scanners[0].ScannerID);

               

                      if (result == DCSSDKDefs.DCSSDK_RESULT.DcssdkResultSuccess)

                          ShowMessage("Establish Communication Successful");

                      else

                          ShowMessage("Establish Communication Failed -- result: " + result.ToString());

                  }

               

                  Button button = FindViewById<Button>(Resource.Id.scan);

                  button.Click += Button_Click;

              }

                • Re: RFD8500 Development using Xamarin
                  Atin Agarwal

                  hi Rick,

                   

                  i did the following steps to create Xamarin Android bindings:

                       1.     Created a new Xamarin Android Binding project

                       2.     Extracted classes.jar file from .aar file and added it to Jars folder in project

                       3.     changed build action to Embedded Jar for jar file

                       4.     within project properties, chose classparse

                       5.     build the project

                   

                  project built okay but had several warnings..not sure if its going to affect anything

                   

                  1>C:\Program Files (x86)\MSBuild\Xamarin\Android\Xamarin.Android.Bindings.targets(383,5): warning : class-parse: warning: method com/zebra/rfid/api3/TagAccess$Sequence.<init>(Lcom/zebra/rfid/api3/TagAccess;Lcom/zebra/rfid/api3/TagAccess;)V: Local variables array has 2 entries ('LocalVariableTableAttribute(LocalVariableTableEntry(Name='this', Descriptor='Lcom/zebra/rfid/api3/TagAccess$Sequence;'), LocalVariableTableEntry(Name='this$0', Descriptor='Lcom/zebra/rfid/api3/TagAccess;'), LocalVariableTableEntry(Name='tagAccess', Descriptor='Lcom/zebra/rfid/api3/TagAccess;'))'); descriptor has 1 entries!

                  1>BINDINGSGENERATOR : warning BG8C00: For type Java.Util.IQueue, base interface Java.Util.ICollection does not exist.

                  1>BINDINGSGENERATOR : warning BG8502: Invalidating Java.Util.IQueue and all nested types because some of its interfaces were invalid.

                  1>BINDINGSGENERATOR : warning BG8C00: For type Java.Util.Concurrent.IBlockingQueue, base interface Java.Util.IQueue is invalid.

                  1>BINDINGSGENERATOR : warning BG8C00: For type Java.Util.Concurrent.IBlockingQueue, base interface Java.Util.ICollection does not exist.

                  1>BINDINGSGENERATOR : warning BG8502: Invalidating Java.Util.Concurrent.IBlockingQueue and all nested types because some of its interfaces were invalid.

                  1>BINDINGSGENERATOR : warning BG8801: Invalid parameter type java.util.concurrent.BlockingQueue<java.lang.String> in managed type Com.Zebra.Rfid.Api3.TransportAbstract.

                  1>BINDINGSGENERATOR : warning BG8401: Skipping Com.Zebra.Rfid.Api3.AttributeInfo.AttNum, due to a duplicate field, method or nested type name.

                  1>BINDINGSGENERATOR : warning BG8401: Skipping Com.Zebra.Rfid.Api3.AttributeInfo.Length, due to a duplicate field, method or nested type name.

                  1>BINDINGSGENERATOR : warning BG8401: Skipping Com.Zebra.Rfid.Api3.AttributeInfo.Offset, due to a duplicate field, method or nested type name.

                  1>BINDINGSGENERATOR : warning BG8401: Skipping Com.Zebra.Rfid.Api3.AttributeInfo.Type, due to a duplicate field, method or nested type name.

                  1>BINDINGSGENERATOR : warning BG8401: Skipping Com.Zebra.Rfid.Api3.AttributeInfo.Value, due to a duplicate field, method or nested type name.

                  1>BINDINGSGENERATOR : warning BG8401: Skipping Com.Zebra.Rfid.Api3.AttributeInfo.PropertyVal, due to a duplicate field, method or nested type name.

                  1>C:\Users\thisi\Desktop\SLEDTestBindings\SLEDTestBindings\obj\Debug\generated\src\Com.Zebra.ASCII_SDK.Command.cs(150,26,150,34): warning CS0114: 'Command.ToString()' hides inherited member 'Object.ToString()'. To make the current member override that implementation, add the override keyword. Otherwise add the new keyword.

                  1>C:\Users\thisi\Desktop\SLEDTestBindings\SLEDTestBindings\obj\Debug\generated\src\Com.Zebra.Rfid.Api3.ReaderManagement.cs(732,30,732,37): warning CS0108: 'ReaderManagement.Dispose()' hides inherited member 'Object.Dispose()'. Use the new keyword if hiding was intended.

                  1>C:\Users\thisi\Desktop\SLEDTestBindings\SLEDTestBindings\obj\Debug\generated\src\Com.Zebra.Rfid.Api3.RFIDReader.cs(746,30,746,37): warning CS0108: 'RFIDReader.Dispose()' hides inherited member 'Object.Dispose()'. Use the new keyword if hiding was intended.

                  1>  SLEDTestBindings -> C:\Users\thisi\Desktop\SLEDTestBindings\SLEDTestBindings\bin\Debug\SLEDTestBindings.dll

                   

                  please let me know if im doing something wrong.

                   

                  thanks,

                  Atin..

              • Re: RFD8500 Development using Xamarin
                Rick Elliott

                So after getting nowhere on the Xamarin front, I decided to install Android Studio and delve into the SDK sample application to see if I could figure out what I was doing wrong.  After a few days of learning, today I finally tracked down the missing piece and it's fairly critical to accessing the scanner.  The Bluetooth services of the Android device must be discovered by the application and provided for the scanner SDK to consume.  As I was following the Zebra Scanner SDK for Android Developer Guide and it didn't show or explain this process, I was under the mistaken impression that the scanner SDK had the Bluetooth device discovery built into the SDK initialization / setup functions.  My Java app that I created exhibited the same problem that I experienced with my Xamarin app, so I knew there had to be something I was missing.  Thank goodness for the sample app -- it took a few days to pull it apart, but without it I would have been completely lost by just following the guide.

                 

                Unless I've missed it, the Android Developer Guide should be updated to explain this part of the process, specifically the code in the HomeActivity and underlying framework pieces in BaseActivity in the sample app.  My next step is to take what I've learned and see if I can transfer it back to Xamarin, as I'm far more comfortable in .NET/C# world and this will be a living enterprise app that my other dev coworkers may need to maintain.

                 

                My other concern is I don't see RFID scanning in the sample app and I haven't seen any references on how to get that working through the SDK in any documentation.  I'm not sure if it uses the same bar code structures or not.  If anyone has Java samples for RFID scanning using the SDK, I would gratefully receive them.  Thanks.

                2 of 2 people found this helpful
                • Re: RFD8500 Development using Xamarin
                  Daniel Pulman

                  Rick, which version of Scanner for Android have you binded? I have tried the last one (2.0.8) and when I build the "Binding Library" project I get this error:

                   

                  Error    CS0234    The type or namespace name 'GenerateBarcode128B' does not exist in the namespace 'Com.Zebra.Scannercontrol' (are you missing an assembly reference?)

                  • Re: RFD8500 Development using Xamarin
                    Atin Agarwal

                    hi guys,

                     

                    i want to develop applications using RFD8500 on Xamarin IOS, Xamarin Android and Xamarin Win 8.1 project.

                    I have already developed all these 3 applications supporting TSL 1128 reader and now want my applications to support RFD8500 as well..

                     

                    are there any sample applications that i can look to get started in either of the 3 platforms?

                     

                    for Xamarin IOS and Xamarin Android, i would need to create bindings for Xamarin. Does anyone have such bindings created?

                     

                    Please help,

                     

                    Thanks,

                    Atin...