Barcode scanner stops working after some time of inactivity

T Tomislav Kralj 3 years 7 months ago
905 3 0

Hello, I noticed that if i dont use scanner for a while (until Android goes to sleep and locks it's screen) the scanner stops working. After i wake up the device my application cannot scan any more. I use Android EMDK. How can i restart the scanner after app returns from sleeping?

Please Register or Login to post a reply

3 Replies

R Ross Rogers

[deleted]

T Tomislav Kralj

For what is worth it does not happen if device is connected in USB debugging mode. If app works stand alone (not attached to a debugger) then this happens.

E Efkan YILMAZ

Hi, yes on newer devices the scanner will sleep when the device sleeps as a power saving feature.  The recommended approach is to disable the scanner during onPause() and reenable it during onResume (see the sample at samples-emdkforandroid-6_6/MainActivity.java at BarcodeSample1 · Zebra/samples-emdkforandroid-6_6 · GitHub )

CONTACT
Can’t find what you’re looking for?