android - To get the XMPP message in the background without using persistent Service -


Hi all I am trying to create an IM using Scout Library. I did it correctly and it worked fine in the foreground and I can start a sticky service which can see messages in the background. My problem is that I should not serve continuously in the background, because it will eat the battery of the Android device, instead I want some broadcast to be broadcast when XMPP message comes with some events. Is there any way I can achieve this? Please forgive me, I have tried to find an example with the search term and I have not got anything, so I have not acquired any kind of reference in this particular context, so there is no relative code !!!

Please advise ...

@Saty

I think it all depends on who You want to archive.

If you need 2 consecutive direct messaging arrival when the customer is online, then I think that continuous service sync is the only solution with XMPP. With the development of solid code it should not have too much battery ...

If you do not really care, the message comes after 2 minutes, for example, you get the intratted service (connect / receive messages) / Disconnect) should be used. ; A timer (like every 2 minutes) is running the app.

The message that you describe (broadcast for broadcasting something when the message is transmitted) is similar to push mechanism like Google Cloud Messaging ...


Comments

Popular posts from this blog

import - Python ImportError: No module named wmi -

Editing Python Class in Shell and SQLAlchemy -

c# - MySQL Parameterized Select Query joining tables issue -