Read sensor values directly

jessPHP

Member
Oct 20, 2013
6
0
0
Hi There!
I just want to know if it is possible to read sensor values directly, without listeners.

Thank you very much!
 
No, sorry, listeners are the only way to get sensor values. My recommendation is to just save the values in your Listener class and call those saved values whenever you like. As soon as you start the SensorEventListener, it will retrieve values.

Also, In order to save battery, it is possible to change the frequency in which you receive that information.

More info: Sensors Overview | Android Developers