【问题标题】:How can an android app track users even when the app is closed?即使应用程序关闭,Android 应用程序如何跟踪用户?
【发布时间】:2015-04-27 04:10:11
【问题描述】:

您好,我对 android 开发非常陌生,因此需要您的帮助。我正在使用 google places api 来获取用户周围的地点列表。基于此列表,我想向用户发送推送通知。我已经为这个函数编写了代码并且它工作正常。但是,即使应用程序关闭,如何使此功能连续运行?例如,假设这个函数被称为 collect_send_notification()。即使用户关闭了应用程序,我也希望此特定功能在后台每 15 分钟运行一次。我相信这是可能的,但需要一些指导。谢谢你。

【问题讨论】:

    标签: android geolocation push-notification google-api google-places-api


    【解决方案1】:

    你需要了解androidServices

    【讨论】:

      【解决方案2】:

      您可以在一定时间后使用 AlarmManager 运行您的代码。这是 android 参考的链接。

      http://developer.android.com/reference/android/app/AlarmManager.html

      【讨论】:

        【解决方案3】:

        我认为这就是您要寻找的: [http://developer.android.com/reference/android/app/Service.html][1]

        并阅读有关本地/全球服务的更多信息。

        【讨论】:

          猜你喜欢
          • 2018-02-18
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          • 2012-11-08
          • 1970-01-01
          相关资源
          最近更新 更多