简体   繁体   中英

Location Tracking, Doze, AppStandby

I've implemented Background Location Tracking using IntentService. I'm able to receive Location points in Foreground Mode. But when a device is locked or after some time app killed, I'm not able to receive location points. How can I handle Doze & AppStandby while tracking the location of a device in the background?

I don't want to run foreground service all the time. Any solution for Background Continuous Location Tracking with handling Doze and AppStandby?

You can implement custom locationlistener or FusedLocationProviderApi ( fused link ) as per fused documentation

The fused location provider manages the underlying location technologies, such as GPS and Wi-Fi.

I implemented the scenario that's not approximately same to yours but in that I had condition to pick targeted location if internet is not available so, i implemented my own Listener that you can find from ( here ) which is connected to the Bind Service.

You also have to implement the location listener with the use of background service. and for the doze you can programmatically turn it off for this app procedure .

If you are using fusedLocationClient API as given in this link then i request you to change your dependencies use Google play services as they provide more feasible and accurate location than fusedLocation API's by android. you can refer the documentation Here and also they provide a solution for your problem using background location tracking

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM