I am currently developing automated tests for our Android applications using Espresso, and I’d like to emulate barcode scanning for some of the scenarios by providing pre-defined barcodes. Is it possible, and how? I am currently testing on the Memor20 but it shouldn’t matter which hardware anyways. The Android SDK is the 1.34.
To be more specific, in this case I am not using intents (which would probably make my life easier). Only the BarcodeManager and the registered ReadListener. I thought about using startDecode() from the BM but of course it just turns on the hardware scanner, it does not provide any barcodes. Also, I cannot call onRead() on the listener directly. Any ideas?