Here is what I want to do:
Some client android phone receive announcement in inrregular time
from server if they have internet connection.
Initially, I put the announcement in database of server and clients access the database to see if there is new announcement in every 15 minutes. But it seems that it is too resources-consuming.
It seems that it is better for the server to send announcement directly. But I have no idea how to implement it. Should I have socket programming? The client phones connect to server and listen to the announcement?
You have to use push notifications.
Check Android Cloud to device messaging starting from android 2.2!
If you want push for earlier versions, check tokudu’s tutorial