title: Push Notification using Firebase and Google Cloud Messaging
body: <p>I want to send push notification in my app (Android) using Google Cloud Messaging. I am using firebase for backend. As firebase do not support inbuilt push notification i am using Google App Engine.</p>
  
  <p>I do not have any idea on Google App Engine. Right now i am using a template provided by google for sending push notification. 
  <a href="https://github.com/GoogleCloudPlatform/gradle-appengine-templates/tree/master/GcmEndpoints" rel="nofollow">Google Cloud Messaging Template Github</a></p>
  
  <p>Till now i have deployed my app in Google App Engine and i am able to send push notification to all devices that are registered (From Web) An HTML page i get when i use GCM template.</p>
  
  <p>What i want to do is , to Listen for Firebase data change and send push notification to user who is not online or has closed the app.</p>
  
  <p><strong>How can i run a servlet in background so that it keeps running in background and send push to user who is not online/connected.</strong> </p>
  
  <p>As i have only push notification logic in Google App Engine Should i use servlet or struts. </p>
  
  <p>Thanks in Advance</p>