Question

I am making a application using asmack. i want to ask is that asmack have listeners like chat listeners, message listener and when we create a room there are many listeners realted to the chat-rooms. These listeners runs in the background thread, but will all these listerners will run if app is moved to the background, or we need to make a service class for this?

Was it helpful?

Solution

The listeners will be run within the thread that calls them. This is usually Smack's PacketReader thread. Android Apps are not moved in background, but something similar happens to Android Activities. You still want to use a sticky non-foreground Android service to hold the reference to your XMPPConnection.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top