I am going to create an Android app. In fact, chat will be a feature of the application. I want to know what are the best practices regarding Android chats. Two options that I'm familiar with are C2MD and just a selective db server polling every few seconds.
Now I know that C2MD should be great and thatβs it, but from my understanding it is not so reliable. I tried to implement it and it does not seem to work. In addition, if for some reason something happens at the end of the googles (for example, their servers are down - itβs unlikely, but it can happen), I canβt contact them and Iβm in their time interval.
Now, if I do my job (a basic approach, when I send a message that the user creates and then periodically checks the server to see if any new messages have appeared), it seems that this is normal, except to have decent user experience, my survey of my server should have been as always 5 seconds or so, and this is going to chew on the battery like crazy. This is really my main drawback from using this approach.
So, I am wondering if there is a better way that I do not know. Please, any help, architecture structures, everything will be useful.
user638049
source share