How to create a communication layer in android
- by Palo
I want to create a communication layer in android. The layer will communicate with server asynchronously. Multiple activities should be able to call methods of the communication layer. The layer will get messages from the server (it is not important for the scope of this question how) and should be able to tell activities to do some work based on these messages.
How should I implement this? Should I do this using android Service?
The main questions that I need to answer are:
How can activities access the layer?
How can the layer access activities?
How can i make the communication layer live for the lifetime of the application?