Вопрос

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?

Это было полезно?

Решение

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.

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top