Fabio Galeppi
Fabio Galeppi

Reputation: 41

Gps, Sensors and wake

I have a program that reads and writes all the sensors values ​​file, but when you turn off the screen stops the listener on the sensors and the record on txt file. I already tried with the wake lock, but with little success, I want to know if you have ideas or if I have to resort to a wake to keep me always on the monitor, let me know. thanks

Upvotes: 0

Views: 182

Answers (3)

Er Boss
Er Boss

Reputation: 56

Solved?

Try onResume and LocationListener

Upvotes: 1

Ridcully
Ridcully

Reputation: 23655

You better should use a Service for listening to the sensors. I did so with my Sports Tracker app and ist works fine.

Upvotes: 1

Gerhard
Gerhard

Reputation: 1362

At least the GPS system (LocationManager.requestLocationUpdates) is working with a wakelock when the screen is turned off. I don't know about the other sensors. (you tagged GPS with your question)

Upvotes: 0

Related Questions