I work with GPS in my application. When the phone goes into sleep mode, GPS data is not updated. I want the phone screen to wake up until my application is close. How can I prevent sleep in Android?
Use WakeLock . Keep in mind that using WakeLock will drain the battery for a long period of time, which your users may not appreciate.
WakeLock
I would try linking things related to GPS as a service in the background, so you don't need to keep the screen active.