I have a POS android with integrate barcode scanner. It has preinstalled barcode app with BARCODE SERVICE in the background. Every time when I press trigger (hardware button), I turn barcode scanner ON.
Now i found solution to turn on barcode scanner with button in my app with this function
The question is whether this program sends any intent with this value? If not then your only option is to read it from the logs with LogCat object. This is however only possible on older versions of Android (prior to Android 4.1).
This integrated barcode application always working in the background with service. When I press hardware button on the left side of device, i turn on barcode scanner, and i can read barcode. Then this service in the background sends this result.
LogCat define this trigger key like KEYCODE_VOLUME_DOWN, but when I create function to detect key, no respond.
Sub Activity_KeyPress (key As Int) As Boolean
log(key)
End Sub