Mark Mark - 1 year ago 86
Android Question

Scanning using remote trigger in ScanAPI

I am using the call within the API:


Why is it firing up the Barcode scanner from ZXing? I would like to fire a physical scan on the Socket 8ci. I am successfully doing this in iOS but the Android SDK seems to be the problem. I would like to confirm if this is the case either way.

Answer Source

As the method name suggests, setSoftScanTrigger triggers the "soft scanner" which is ZXing on Android.

That method just calls a method on ScanApiHelper, passing in the soft scanner as the device to be triggered.

public void setSoftScanTrigger(char action) {
    _scanApiHelper.postSetTriggerDevice(_softScanDevice, action, _onSetTrigger);

If you have a reference to the physical device you'd like to trigger, you could trigger it in the same way.

You would need to modify your SingleEntryApplication, because it doesn't keep any references to physical scanners, by default. However, you can set and unset your physical device reference in the same place as it sets and unsets the reference to the soft scanner - the onDeviceArrival and onDeviceRemoval methods.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download