0

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.

Arun Badole
  • 10,977
  • 19
  • 67
  • 96

2 Answers2

0

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.

Community
  • 1
  • 1
Orlymee
  • 2,349
  • 1
  • 22
  • 24
0

I got the way from here.

Arun Badole
  • 10,977
  • 19
  • 67
  • 96
  • While this may theoretically answer the question, [it would be preferable](http://meta.stackexchange.com/q/8259) to include the essential parts of the answer here, and provide the link for reference. – Bill the Lizard Mar 28 '12 at 13:14
  • @Bill the Lizard : I will take care of it.Thanks – Arun Badole Mar 29 '12 at 04:55