Just wondering if there is a way to get the light sensor value on an Android phone without waiting for the onSensorChanged () event? To save battery, I use registerListener () and unregisterListener () after getting one lux value, however the next time I register the listener to get a different value, if this value is the same as before, my application sits there, waiting an event that may take some time (usually in low light situations).
So, is there a way I can read the lux value without waiting for the onSensorChanged () event? Or should I just have a timeout of 100 ms and then use the last value that I wrote down?
Thanks!
source share