I am building a message application.. in which the UI should get notified when the new message come in the system...
What is best way to achieve it?..
One way is to create a background task that will poll server every one minute to see if there are any new messages in last one minute.. If this is the case then, where would this code of polling should go?.. because.. this task should be initiated every time user logs in into the system.
Is there any other way through which server will notify the UI as and when there are new messages in the system and UI will refresh itself to show some animation to depict that there are new messages in the system..