-1

I am trying to implement something similar to Google Cloud Messaging and I have a working XMPP service on my phone and XMPP server configured.

Could someone please tell the architecture on the phone? How does android know when to show a notification for an incoming message? and when to update the application?

For Example, In Google Hangouts, when you get a new message, the notification is displayed and if the user is in the conversation frame, the conversation gets updated.

Anil Maddala
  • 898
  • 16
  • 34
  • "How does android know when to show a notification for an incoming message? and when to update the application?" -- that would be a question for whoever wrote your XMPP client library. – CommonsWare Mar 03 '15 at 19:40

1 Answers1

0

For notifications you have to go through this tutorial android notifications, the client libraries like smack abstract for you the communication between XMPP Server and clients, you listen to incoming Messages and whenever a message arrives you display a notification. I hope this could help you.

udito
  • 56
  • 3
  • 1
    I am using SMACK and am able to receive the messages and show notifications. This is fine when the chat application is closed. But when the chat application is open, the notifications shouldn't show and the chat application needs to be updated. That's my question. – Anil Maddala Mar 03 '15 at 20:40
  • I saw one related code to what are you looking for, I didn't test it but here is the link for the case you want to play around with it? [link](http://stackoverflow.com/questions/16394666/show-push-notifications-when-application-open-closed-in-different-way) – udito Mar 03 '15 at 21:00