简体   繁体   English

位置追踪?

[英]Location Tracking?

We have a requirement of tracking user location using our android application. 我们需要使用我们的android应用程序跟踪用户位置。 Users have application installed in their phone. 用户在手机中安装了应用程序。 But we are facing a problem, in some cases eg app going in background, device locked application does not send locations. 但是我们面临一个问题,在某些情况下,例如应用程序在后台运行,设备锁定的应用程序无法发送位置。

How to make sure that application send location update at regular interval irrespective of app being in foreground/background. 如何确保应用程序以固定的间隔发送位置更新,而不管应用程序位于前景/背景中。

We are using API 24 and fused-location-provider. 我们正在使用API​​ 24和fused-location-provider。

Check out this project on github. 在github上查看此项目 It might help you. 它可能会帮助您。 This app sends location updates every 3 seconds to the server and is not killed even if the device is locked or if the app gets in background. 此应用每3秒将位置更新发送到服务器,即使设备被锁定或应用进入后台,该应用也不会被杀死。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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