Purpose: I'm trying to make a real-time web service in Java. When there're changes in database, the data in clients(probably Android client) will be changed automatically without refreshing.
Platform: I'm using Tomcat 7 container and Axis2.
Problems: I'm stuck in the way to approach. I've realized that there were 2 ways: 1. When the data in server changes, notice to all the clients. Web-service allows us to do this, but I don't know what clients I have to inform! 2. Clients connect to the server, keep the connection alive and whenever there's a change, update data. However, if the client is the handheld, it will consume much power and data exchange over 3G network.
I know that's a complicated problem. So I just want to ask if there is an efficient way to approach? And if possible, anyone can give me one example of realtime web service like this? I've searched over many pages, but nothing's helpful. Can anyone give me some suggestions? Tkx!