【发布时间】:2016-08-14 03:41:39
【问题描述】:
您好,我想在后台连续运行的服务中编写融合位置。我可以在其中编写将位置发送到服务器的代码。我已经在 Activity 中实现了它,现在我想在 Service 中实现它。请帮助我。
【问题讨论】:
标签: android google-maps service fuse
您好,我想在后台连续运行的服务中编写融合位置。我可以在其中编写将位置发送到服务器的代码。我已经在 Activity 中实现了它,现在我想在 Service 中实现它。请帮助我。
【问题讨论】:
标签: android google-maps service fuse
您可以扩展服务并实现方法
public class BackgroundLocationService extends Service implements
GooglePlayServicesClient.ConnectionCallbacks,
GooglePlayServicesClient.OnConnectionFailedListener,
LocationListener
检查此代码以实现Background location services.
请记住,只需正确删除您的位置更新。否则服务不会通过调用 stopService 方法停止
【讨论】: