解决您的问题的一个非常简单的方法是使用 服务.它将允许您在后台执行各种任务,并且是您将您的位置发送到服务器静默的***选择.
A very simple answer for your problem is to use Service. It will allow you to perform variety of tasks while being in background and is your best bet for sending your location to server silently.
阅读此答案以获得帮助.