title: Android device needs to be connected to server - C2DM, polling or something third?
body: <p>I'm currently in the process of developing an app which has some <em>very</em> demanding needs.</p>
  
  <p><strong>The Project</strong></p>
  
  <p>An application which can communicate with a server is needed.
  Small messages has to be send to the app which could display a notification or start an activity.</p>
  
  <p><strong>The Demands</strong></p>
  
  <p><em>Client needs to be sure that the phone is 'connected' at all times.</em>
  <br>The client expects that the app can tell when it's no longer connected (or able to connect) to the server it tells the user.</p>
  
  <p><em>Client needs to be able to send a message to individual devices</em>
  <br>If the client needs to broadcast a message to the connected devices and to the individual devices.</p>
  
  <p><strong>My thougts (or problems)</strong></p>
  
  <p>Currently, the app is polling the server with a http request once a minute - if the app isn't able to connect to the server the user gets notified. The polling is able to tell which device is calling and telling it if it has a message for it.</p>
  
  <p><em>But...</em></p>
  
  <p>IMO this is a terrible design - it generates a lot of excess traffic, uses resources which probably wasn't necessary and it offers a lot of issues with connectivity (which I'm not sure I'll ever get past no matter which method is used).</p>
  
  <p>I need your experience to select the right solution for my project.</p>
  
  <p>I've been thinking of C2DM, but I'm not sure this could cover my needs?
  Is polling for my only real solution?
  Is there a third option I haven't thought about? </p>