My application requires me to periodically do the following:
- Send periodic heart rate information to the server every 15 seconds
- Periodically capture the screen and send them to the server once every 60 seconds
- Send a message and poll the server for messages every 5 seconds
I wrote services for each of the above elements, but here I need help, the connection between these services ...
The heartbeat service should be able to:
- Get information from the screen capture service.
- Message queue using the messaging service.
The screen capture service should be able to do the following:
- Get current activity from my application
- Message queue using the messaging service.
The messaging service should be able to do the following:
- Receiving messages in the queue for sending to the server from my application / services
- Send messages received from the server to the application
With all the necessary communication paths, I wonder how to do this? Can I just bind my application to all services? Link services to other services? Use any other way of communication?
I need all these services to continue to work / work, even if my application is not in the foreground.
android android-service android-service-binding
Ryan
source share