TLDR: I am wondering what is the best practice in android to do the following - when new data is stored in server side database inform and transfer data to android application ?
LONG STORY: I currently have server side application based on Node.js and MongoDB where I store my data in JSON format. Server (Node) exposes REST service which I call when I want add new data to database. I have another REST service which is called by android application client when refresh local data button is pressed. Everything is working like a charm, but I want to extend my android client application, so the data is transferred to application as soon as it comes to server. I have been looking at combination of:
AsyncTask(http://developer.android.com/reference/android/os/AsyncTask.html) and
BroadcastReciever (http://developer.android.com/reference/android/content/BroadcastReceiver.html).
But I am not sure if this is the right way to do it. Also I know I will have to make changes to my server side application, but this is not a problem.
So I am not looking for exact code how to do it, but for some advices what should I use.
http://en.wikipedia.org/wiki/Push_technology
http://en.wikipedia.org/wiki/Google_Cloud_Messaging
https://developers.google.com/cloud-messaging/
third one is the actual answer, but first ones have details