location-samples icon indicating copy to clipboard operation
location-samples copied to clipboard

FusedLocationProviderClient requestLocationUpdates() acquire wakelock long time

Open plaichat1986 opened this issue 5 years ago • 1 comments

I use FusedLocationProviderClient.requestLocationUpdates to location。 My app is a sport app, so it need to location all the time while user start to run. But after start to run with a notification, screen off , a few minutes later, my app was killed by rom for long time holding wakelock. If i close the requestLocationUpdates, my app won'te be killed.

Could you please tell me how to long time location without acqure wakelock for long time?

plaichat1986 avatar Jun 08 '20 13:06 plaichat1986

Have you solved this? I have the same problem. The OS stop sending GPS location when the screen turns off even when it has been granted background permission by the user. My app needs to send the GPS back to the server every 4 seconds no matter what, yet the OS stop send GPS location anyway. So what if the user is jogging does google expect them to hold the phone in their hands to keep the screen on to prevent it going to sleep? they are not allowed to put the phone in their pocket while they jog and have the app work anyway?

nsmith1024 avatar Jul 26 '21 03:07 nsmith1024