简体   繁体   English

如果Android杀了我的应用程序并且我从设置中执行强制关闭,我会收到GCM消息吗?

[英]Will I receive GCM messages if Android kill my app and if I do a Force Close from the settings?

I'm a newbie to Android development and I'm interested in two things which is connected to Google Cloud Messaging. 我是Android开发的新手,我对与Google Cloud Messaging相关的两件事情感兴趣。

  1. Does Android absolutely kill applications if they run for a long time in background as iOS does? 如果iOS在后台运行很长时间,Android是否会绝对杀死应用程序? And if so will I receive GCM notifications after my app was killed by Android? 如果是这样,我的应用程序被Android杀死后会收到GCM通知吗?
  2. Is there some difference between Force Close (from the settings menu) and when the app is killed by Android? 强制关闭(来自设置菜单)和应用程序被Android杀死之间有什么区别吗? And if I do Force Close will I receive GCM notifications? 如果我强制关闭,我会收到GCM通知吗?

1 - yes, but if you install in your manifest a broadcast receiver that listens for the gcm, it will triggered anyway. 1 - 是的,但是如果你在你的清单中安装了一个收听gcm的广播接收器,那么无论如何都会触发它。 What you will do with that event depends on your app. 您将对该活动做些什么取决于您的应用。 A common practice is to start an intent service that handles the message. 通常的做法是启动处理消息的intent服务。 It's up to you to make interact with the activities of your app. 您可以通过应用程序的活动进行交互。

2 - From android 3.1, if the user force closes your app, it will stop to be notified of any broadcast until the user does not start your app again. 2 - 从Android 3.1,如果用户强制关闭您的应用程序,它将停止通知任何广播,直到用户没有再次启动您的应用程序。 Check "Launch controls on stopped applications" here for more details. 有关详细信息,请在此处选中“启动已停止的应用程序的控

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 我的应用未收到来自GCM的任何消息 - my app doesn't receive any messages from GCM 我想通过在当前应用程序中按一个按钮来终止/关闭特定应用程序。 我怎样才能做到这一点? - I want to kill/ close a particular app by pressing a button in my current app. How can I do this? 如何在同一测试中使用Appium在Android中从内存中强制关闭/强制关闭/杀死应用程序 - How to hard close/force close/kill the app from memory in Android using Appium in the same test 我向GCM发送了7条消息,并收到35条消息的回复 - I send 7 messages throw GCM and receive respond for 35 messages 如何将GCM消息从GcmListenerService路由到其相关处理程序? - How do I route GCM messages from a GcmListenerService to their relevant handlers? 我可以强制我的Android应用从Play商店进行更新吗? - Can I force my Android app to update from the Play Store? 我收到消息,但它们不会显示在状态栏上(我的应用程序在后台100%) - I receive messages, but they are not displayed at statusbar(my app is in the background 100%) 测试我的应用程序时,请保持力量关闭 - Keep getting Force close when I test my app Android 当我单击某些意图时应用程序强制关闭 - Android App Force Close when i click some intent 为什么我的Android应用程序强制关闭 - why my android app force close
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM