in my opinion, hid mode is not all that slow. the alternative - reading from the device directly - is faster, but it could be much more inconvenient than
having an hid scannner populate a label or edittext. if the scanner does not support "interrupt mode", then every time you press the trigger to scan a
barcode, you will then have to tap a button in the app to read the result from the scanner. the device is designed to act like a keyboard.
i think there are examples here relating to different hardware scanners. i really wouldn't know what to search for. that's why i implemented my own
utility. and because of the inconvenience i describe above, i don't use it "in production". it's just much easier to let the scanner do what it does naturally.
in any case, you first need to query the attached devices and find out which one is the scanner and what it's capable of doing (eg, does it support "interrupt mode").
then you need code to address that. i can probably convert my code to a library to let you see what the scanner advertises, but you may find something else before i get to it.
if your scanner has a bluetooth mode and supports spp, i'm pretty sure you'll be able to find an example. communication with bluetooth devices is
much more common than with otg (you can only have 1 device at a time, and external drives and keyboards come with drivers that basically save you the
time needed to figure out how to communicate with them natively).