Why does GPS not work on certain devices when the screen is off?

I am developing an Android application. I found that GPS does not work on certain devices (Samsung Galaxy S version 2.2.1, Samsung Galaxy Ace version 2.3.6 Gingerbread, Motorola Diffy 2.2) if the screen is off. It works great on other devices (HTC Wildfire 2.3.3), even if the screen is off. Why is this?

+4
source share
2 answers

I'm not sure this is happening, but I ran into a similar problem with the accelerometer. It will not give any sensor readings when the screen is locked. So what I did when I want the sensor readings, I just locked the call block every 5 minutes, so the screen turns on, and then I get the sensor readings. Should be useful for you. The user does not need to do anything manually.

+2
source

This WakeLock allows you to use sensors when the screen is off (unlike other wakelocks). Everything he does is constantly supported by the processor.

+1
source

Source: https://habr.com/ru/post/1412906/


All Articles