I a am building an android application and at some point I need to build a new specific "Thread", let's call it A.
- A will communicate with a distant server (download pictures and send some small data)
- A will communicate with several activities of my application (send int/string)
- A need to stay alive even if the application is closed
- A will stay alive for a specific duration (around 10 minutes)
What should A be ? a Service ? an AsyncTasck ? I think it can't just be a thread because a thread is linked to a specific activity butI might be wrong.
Bonus question : what is the best way to communicate between A and my Activities ?
Thank you for your help.