Welcome, Guest. Please Login.
Linuxslate.com Forums

<=== Back to the Linuxslate.com Homepage

Sep 19th, 2019, 1:07am
News: Welcome to the linuxslate.com forums. 16 Janruary 2015: Forum registration has been disabled due to recent advancements in bypassing captcha's and the resulting increase in spam on the forums. Registration will be re-enabled at a later date. In the meantime, if you need to register, or have relevant information, please email "john" at this domain, or request an account using the linuxslate.com Google+ Page: https://plus.google.com/+Linuxslate/


Pages: 1
Sensors and Partial wake lock (Read 2805 times)
Jimmy
Thinks a tablet is something you take for a headache
*


Linuxslate.com
Forums

Posts: 5
Sensors and Partial wake lock
Oct 31st, 2012, 10:46am
 
I'm doing some stuff with android devices that requires me to get accelerometer and GPS readings over a long time frame (hours rather than minutes). On other android platforms I use a partial wake lock and turn the screen off so I can gather data and try to save on battery. The Z1 does not support sensors being active without the screen being on. The partial wake lock for the Z1 keeps the CPU on ok, just not the sensors. This works on some platforms and not on others.
 
Is there any way the behavior I need could be achieved by either of:
 - upgrading to the latest firmware
 - using a custom ROM
 - writing a custom ROM
 - changing the device drivers (is this even possible on an android device in general or the Z1 in particular?)
 - installing a more recent android version (again, is this even possible?)
 
Any insight into this would be much appreciated.
Back to top
 
 
  IP Logged
Jimmy
Thinks a tablet is something you take for a headache
*


Linuxslate.com
Forums

Posts: 5
Re: Sensors and Partial wake lock
Reply #1 - Feb 7th, 2013, 5:39am
 
I've made some progress with this issue so though I'd update the thread.
 
It turns out that running under a partial wakelock with the keyguard turned off will allow the accelerometer to gather data after the device goes to sleep. Code snipped for turning the keyguard off below. I'm running some tests on the Z1 at the moment and I'll update this thread again when I know more.
 
Code:
Window window = getWindow();
window.addFlags(WindowManager.LayoutParams.FLAG_DISMISS_KEYGUARD 

Back to top
 
 
  IP Logged
Pages: 1