I'd like to know if there's any effective way how to deal with a situation when I need an Android client app to listen until it is called by a server - some kind of socket listener or so. I need the Android client app to be notified when server sends data, asynchronously. A simple example: I am running a chat service on server (
Java app) and several Android clients connected and able to post messages. When any of the connected clients sends a message to the server, it processes it and notifies all other connected clients about this new post. Is there any effective way to do so? I do not much favor for the infinite loop workaround if there's better way. Thanks.