即使应用程序关闭,Android应用程序如何跟踪用户?

时间:2015-04-26 19:50:39

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

嗨,我对Android开发很新,所以需要你的帮助。我正在使用google places api来获取用户周围的地方列表。根据此列表,我想向用户发送推送通知。我已经编写了这个函数的代码,它正常工作。但是,即使应用程序关闭,如何使此功能连续运行?例如,假设此函数名为collect_send_notification()。即使用户已关闭应用程序,我希望此特定功能在后台每15分钟运行一次。我确信这是可能的,但需要一些指导。谢谢。

3 个答案:

答案 0 :(得分:1)

您需要了解android Services

答案 1 :(得分:0)

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

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

答案 2 :(得分:0)

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

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

相关问题