Reputation: 5757
I have android application such a way that If user send feedback to another user then that receiver
user gets notification
about it, same like whatsapp.
What should i use for that ?
If Google Cloud Messaging
good option or anything else is there ?
Upvotes: 1
Views: 103
Reputation: 2669
Three approaches:
Steady connection. Your client application have a steady connection and list for server notifications. [inefficient for battery]
keep-alive
connection to server, and server does not respond until it has some events for you, as soon as your client get the response(which is not actually a response!) your client must send another request to server to listen for future events. XMPP protocol is a good option for this approach. there is also a java library called Smack and and android optimized ported library called aSmack. you must have an XMPP server too.Google Cloud Messaging known as GCM
I think a combination of GCM and WebSocket is a good approach.
Upvotes: 1