3 Replies Latest reply on Jun 24, 2016 12:23 PM by Rick Elliott

    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 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

            • 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
              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.