I want to create a background service which continuously check that is there any message that has come from server.
I am trying using AsyncTask but I am not getting how can I know when any message will come or has arrived.
Please Help.
I want to create a background service which continuously check that is there any message that has come from server.
I am trying using AsyncTask but I am not getting how can I know when any message will come or has arrived.
Please Help.
I take it that you are polling at a set inerval to your web server to figure out the state. Simply read the response from your web server and take action.
Read this post Example: Communication between Activity and Service using Messaging
Alternately try using the Cloud to device messaging.
If you want to go really large scale use XMPP.
I got the way from here.