Barcode scanner stops working after some time of inactivity

T Tomislav Kralj 2 years 11 months ago
561 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.

V Vedsatx Saddvv

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?