views:

69

answers:

2

Hello

I 'm working with GPS in my application. When phone go to sleep, the GPS's data don't update. I want to stay phone screen wake up until my app will be close. How can I prevent sleeping in Android?

A: 

Use a WakeLock. Bear in mind that using a WakeLock for a long period of time will drain the battery, which your users may not appreciate.

CommonsWare
A: 

I'd try to have the GPS related stuff running as a service in the background so you don't have to keep the screen active.

Octavian Damiean