【问题标题】:how to Fused location Run in Background service continuously如何融合位置在后台服务中连续运行
【发布时间】:2016-08-14 03:41:39
【问题描述】:

您好,我想在后台连续运行的服务中编写融合位置。我可以在其中编写将位置发送到服务器的代码。我已经在 Activity 中实现了它,现在我想在 Service 中实现它。请帮助我。

【问题讨论】:

    标签: android google-maps service fuse


    【解决方案1】:

    您可以扩展服务并实现方法

    public class BackgroundLocationService extends Service implements GooglePlayServicesClient.ConnectionCallbacks, GooglePlayServicesClient.OnConnectionFailedListener, LocationListener

    检查此代码以实现Background location services.

    请记住,只需正确删除您的位置更新。否则服务不会通过调用 stopService 方法停止

    【讨论】:

    • 私有LocationClient mLocationClient;方法现已弃用
    • 你检查过链接吗?
    • 是的。我已经检查了这个链接这个链接使用 LocationClient 现在它已弃用
    • 勾选此项并根据新方法更改方法stackoverflow.com/questions/24611977/…
    猜你喜欢
    • 2017-09-19
    • 2019-05-08
    • 2018-10-31
    • 1970-01-01
    • 2018-10-18
    • 1970-01-01
    • 2020-01-19
    • 2021-01-01
    • 1970-01-01
    相关资源
    最近更新 更多