title: PUSH Notifications from a Web service
body: <p>I have a web service that stores locations of a mobile user in the DB periodically. I now want to try sending <code>push</code> notifications from the web service to the <strong>Android</strong> app. I understand that this can be achieved using <strong>GCM for Android</strong>.</p>
  
  <p>However, I am not sure how I can run a process that continuously monitors the DB for a condition. Can somebody suggest how I can achieve this?</p>
  
  <p>Will creating a <code>thread</code> to do the monitoring task in the <code>constructor</code> of the web service help to maintain a constant monitor?</p>
  
  <p>P.S: At the moment I am just starting a thread which will check the DB for the condition I need when the app calls the store method and then sends <code>POST</code> request to GCM server to push notifications if the condition is satisfied.</p>