Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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.

  1. Does Android absolutely kill applications if they run for a long time in background as iOS does? And if so will I receive GCM notifications after my app was killed by Android?
  2. Is there some difference between Force Close (from the settings menu) and when the app is killed by Android? And if I do Force Close will I receive GCM notifications?
like image 505
MainstreamDeveloper00 Avatar asked May 13 '13 17:05

MainstreamDeveloper00


1 Answers

1 - yes, but if you install in your manifest a broadcast receiver that listens for the gcm, it will triggered anyway. What you will do with that event depends on your app. A common practice is to start an intent service that handles the message. 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. Check "Launch controls on stopped applications" here for more details.

like image 114
fedepaol Avatar answered Oct 05 '22 23:10

fedepaol