Why gmail / yahoo / that the application does not kill?

I have an intent service that constantly checks to see if the data has changed on the server. The problem is that the application remains inactive for some time, it stops receiving notifications. We suspect that the service was killed by the android.

I think that even GCMINTENTSERVICE is also killed by android for some time.

  • My question is how gmail / is that / yahoo mail app is always synced without a foreground notice. What kind of synchronization mechanism do they use.

  • Do you know about any other application that always receives a notification, even if it is in the background, so I can check with Google why it has not been killed for some time.

  • Google kills the gcmintentservice if it has been running for some time in backgroud.

EDIT: GCMBASEINTENTSERVICE is a service we plan to implement for push notifications, because with the help of an older polling service, the application did not receive a notification after a while. Perhaps this is due to the fact that for some time he was killed by the android. So, with push notifications will the application always receive a notification? Is Gcmbaseintentservice a service of intent, and it will also be killed by the android after a while.

+4
source share
1 answer

After a while, Android will kill the services to solve memory problems. It is not always useful to always run the application in the background, as it will consume memory and processing power.

  • You have a wrong idea. GMail and Yahoo did not poll for new mail, they use the Push Notification mechanism, more precisely Google Cloud Messaging or GCM. Push notifications can be received in the background, and after receiving push notifications, they synchronize the application.

  • BBM (BlackBerry messenger) did not use GCM because they relied on BlackBerry servers. Therefore, they ran the application in the background without killing it. This is always done by showing a notification without swipeable. At some point with a notification, you can start the service in the background without killing it.

According to AndroidHeadlines

You can leave it constant if you want to use BBM. In Android 4.3, Google began to struggle with applications that suck the battery out and stay alive, not knowing. Now you need any application that wants to run in the background to place a permanent icon in your notification. BBM badge. This allows this particular application to never be closed.

  1. Of course, Google will kill any service if the device runs out of memory or new services are running in the background.
+2
source

All Articles