[英]Efficient Background service for tracking user location
I am developing a small android application in which I want to have Geolocation functionality. 我正在开发一个小型Android应用程序,我希望在其中具有Geolocation功能。 What I want to code is one service which gives the updated location of a user whether they are using my application or not.
我想要编码的是一种服务,它提供用户的更新位置,无论他们是否正在使用我的应用程序。
I know that if I am continuously checking the user's location it will drain the battery of the device, so I want good solution for that. 我知道,如果我不断检查用户的位置,它会耗尽设备的电池,所以我想要很好的解决方案。 For example, to give me updates every 5 or 10 minutes.
例如,每隔5或10分钟给我更新一次。 I have read about this question a lot but I wanted to get one good solution.
我已经阅读了很多这个问题,但我想得到一个好的解决方案。
I read this page and it's a good solution if the user is using my application but if the user not using my application then what should I do? 我读了这个页面 ,如果用户正在使用我的应用程序,但如果用户没有使用我的应用程序那么这是一个很好的解决方案,那么我该怎么办? How do I solve this challenge?
我该如何解决这一挑战?
Previously i have developed such kind of application. 以前我开发过这种应用程序。 with respect to your requirement, you will be require following APIs from Android.
根据您的要求,您将需要Android的以下API。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.