0

I am trying to get an existing RhoMobile APK running on a TC52, Android 8.1. The App is running fine on TC51, Android 6. On the TC52, when i start the app I get a toast message

DS8178 Bluetooth Scanner is not connected, therefor BTPairing Utility will be started.

The problem is that - ignoring the BTPairing Utility App (i also tried to disable it) - i cant use the build in scanner in my rho mobile app. When I try to use it I see the following message in the log

"The decodeSound barcode property can only be set once the scanner has finished initialising"

Looking at the underlying code, it looks like that the scanner has not initialised, probably due to not be able to pair the bluetooth scanner. But there is now such scanner and there never will be. Anybody know how to disable this behaviour?

Edit 1: Here is my javascript code for enabling the scanner

 Rho.Barcode.enable({ allDecoders: true }, this.onScan);

But, I think it happens before that javascript is accessed; the app is hosted on web server; even if i disable WIFI and starting the app, the toast is displayed. It seems like that RhoMobile is trying to setup all known scanners.

Edit 2: When I enumerate all scanners, i get those in this order

Scanners found: '[
    "Camera Scanner",
    "2D Barcode Imager",
    "Bluetooth Scanner",
    "RS6000 Bluetooth Scanner",
    "DS3678 Bluetooth Scanner",
    "LI3678 Bluetooth Scanner",
    "DS2278 Bluetooth Scanner",
    "DS8178 Bluetooth Scanner"]'
Default scanner: '2D Barcode Imager'

Default scanner is determined by

Rho.Barcode.getProperty("friendlyName");

Edit 3: Ok, as suggested in the comments, using the actual instance returned from the enumeration works; triggering scanner buttons works well.

What remains is the toast that asks to connect the DS8178 Bluetooth Scanner; is there a way to disable scanners from config.xml?

Delphi Coder
  • 1,723
  • 1
  • 14
  • 25
esskar
  • 10,638
  • 3
  • 36
  • 57
  • 1
    From your description, it seems like you are enabling the wrong scanner... I suspect the DS8178 support was introduced in TC52 and you are hardcoding which scanner index is being enabled, but that's just a guess... can you paste the code (JS or Ruby) where you are enabling the scanner? – Darryn Campbell Apr 08 '20 at 08:35
  • @DarrynCampbell thanks for the hint, but the toast is displayed before the javascript code is available from the web server. see my edit for more details. – esskar Apr 08 '20 at 09:24
  • 1
    I think you might want to call Rho.Barcode.enumerate() then from the returned array of barcode objects look at the friendlyName property and choose the one that is something like 'internal imager' or '2d imager'. Then call enable() on that barcode object. It looks like the DEFAULT barcode object being used is the DS8178 which is not desired. This may have been fixed in the latest version of RhoMobile but I don't know... there is also an active developer forum on Tau-Technologies website (who support Rho) if you don't get a satisfactory answer on SO – Darryn Campbell Apr 08 '20 at 09:33
  • @DarrynCampbell your suggestion works, check my latest update. thanks for the help. – esskar Apr 08 '20 at 11:25

1 Answers1

1

This error:

DS8178 Bluetooth Scanner is not connected, therefor BTPairing Utility will be started.

Is not coming from RhoMobile, it is being generated from the low level scanning framework. I checked on a more up to date device and I'm glad to say they fixed the spelling error. It is caused when something (either EMDK or DataWedge) tries to enable the DS8178 scanner. The DS scanner support was only added in a recent version of the mobile computing scanner framework so that probably explains the difference in behaviour you are seeing between TC51 and TC52.

RhoMobile (on Zebra Android devices) wraps the EMDK and exposes each supported scanner as a separate Barcode object and you can see all of these in the array returned from enumerate. What is strange is that, per your second edit, the default scanner is '2D Barcode Imager'.

There are a few options / possibilities:

  • There is a bug in the RhoMobile framework and for some reason the DS8178 scanner is being enabled. I checked https://github.com/rhomobile/rhodes/tree/master/lib/commonAPI/barcode/ext/platform/android/src/com/rho/barcode and cannot see any such bug. Rho is open source but supported by Tau-Technologies if you wanted to explore that route.
  • Something else on your device is enabling the DS8178 scanner, e.g. a DataWedge profile or other app using the EMDK. You could disable DataWedge (from the DataWedge app settings) and reboot your device to test this.
  • There is an issue with the TC52. I would say this is the least likely as I have never heard of a similar issue

There is no way to disable any of the scanners via XML

Darryn Campbell
  • 1,441
  • 10
  • 13
  • Do you have an idea for https://stackoverflow.com/questions/64044867/rhomobile-and-datawedge-receiving-intents as well? – esskar Sep 25 '20 at 05:55