Android chat service

I am trying to create an application similar to what is up or a messenger for training.

Basically, I created an operation that binds to a service that connects to the java server using TCP / IP.

While the service is active, the user receives and sends messages. The problem is that the user closes the application (for example, using the task manager - pressing the "Home" button). If the application is closed, the service is killed because it has 0 bindings.

My question is: what is the template for such applications so that the user always receives messages, as always, it is possible to send messages and maintain their service.

Thank.

+5
source share
3 answers
+1

, OneSignal : OneSignal

, Push Notifications: . Cloud Messaging .

, , STICKY_SERVICE: start-sticky-and-start-not-sticky

, , , FCM: Firebase Cloud Messaging

: android-migrate-fcm :

Firebase Cloud Messaging (FCM) is the new version of GCM. It inherits the robust and scalable GCM infrastructure as well as new features! See Frequently Asked Questions to find out more. If you are integrating messaging into a new application, start with FCM. GCM users are strongly encouraged to upgrade to FCM to take advantage of the new FCM features today and in the future.

0
source

All Articles