My customer has a Cordova app calling the EMDK.JAR library for scanning. The app was ported from IOS to Android.
The app is working fine, in fact it runs so fine the users never have to toucn the screen, they can pretty much complete their tasks via viewing screen and listening for application beeps. The problem is that without any touch activity, the screen timeout and locks kick in even though the users are actively in the app. On the IOS device, the scan events kept the screen from locking.
Is there a method or technique they can use to simultate touch events or send an itent to reset screen sleep timer?
"Another issue she reported was regarding a scan not counting as a touch on the device (See below). We had this same issue on the iPods when we rolled them out. Is there a way to fix this on Android?
Another issue we've run into is the screen locking. When we first got the device, the sleep timer was set to 30 minutes. We changed it to 1 minute on all of them due to battery life opportunities. However, for price change or instocks, when they are scanning, they rarely touch the screen. After a period of time not touching the screen, the device will lock and no longer capture what they are scanning. On the myDevice, a scan "counted" as a click on the screen to keep the device awake. "
Method to keep Android Screen Active// Expert user has replied. |
2 Replies
Chris, the safest way to do this would be to choose any view in the applications Activity and set its keepscreenon property to true. Below is the method that can be used for Java, you/they will need to figure out Cordova equivalent
https://developer.android.com/reference/android/view/View.html#setKeepS…
There's a real good article on StackOverflow regarding setting KeepScreenOn in a cordova app:
changing KeepScreenOn from javascript in Android cordova app - Stack Overflow