0

I'm not an Android user, but I have an Android user as a contact in my XMPP roster (instant messaging). I noticed that his presence switches from "Away" to "Offline" rotatory when his smartphone is not in use (but constantly connected to his private WLAN).

See for example the following status changes for his account from tonight (while he was sleeping, so no activity with the phone):

[00:05:13] Status: Offline
[00:06:02] Status: Away: AutoStatus (idle)
[00:18:14] Status: Offline
[00:21:17] Status: Away: AutoStatus (idle)
[00:35:15] Status: Offline
[00:36:32] Status: Away: AutoStatus (idle)
[00:50:47] Status: Offline
[00:51:52] Status: Away: AutoStatus (idle)
[01:00:08] Status: Offline
[01:01:14] Status: Away: AutoStatus (idle)
[01:15:13] Status: Offline
[01:16:31] Status: Away: AutoStatus (idle)
[01:25:13] Status: Offline
[01:25:44] Status: Away: AutoStatus (idle)
[01:40:13] Status: Offline
[01:41:00] Status: Away: AutoStatus (idle)
[01:49:14] Status: Offline
[01:50:14] Status: Away: AutoStatus (idle)
[02:15:17] Status: Offline
[02:17:32] Status: Away: AutoStatus (idle)
[02:31:19] Status: Offline
[02:32:48] Status: Away: AutoStatus (idle)
[02:52:20] Status: Offline
[02:54:04] Status: Away: AutoStatus (idle)
[03:07:52] Status: Offline
[03:09:18] Status: Away: AutoStatus (idle)
[03:22:52] Status: Offline
[03:24:34] Status: Away: AutoStatus (idle)
[03:37:55] Status: Offline
[03:39:48] Status: Away: AutoStatus (idle)
[03:53:26] Status: Offline
[03:55:03] Status: Away: AutoStatus (idle)
[04:08:57] Status: Offline
[04:10:18] Status: Away: AutoStatus (idle)
[04:23:57] Status: Offline
[04:25:32] Status: Away: AutoStatus (idle)
[04:39:28] Status: Offline
[04:40:47] Status: Away: AutoStatus (idle)
[04:54:29] Status: Offline
[04:56:04] Status: Away: AutoStatus (idle)
[05:09:30] Status: Offline
[05:11:19] Status: Away: AutoStatus (idle)
[05:24:31] Status: Offline
[05:26:34] Status: Away: AutoStatus (idle)

He uses the XMPP client Jabiru. He can't explain why this is happening; he doesn't find any settings that could be responsible for this.

I googled if it is a known bug and found this statement (in German) in a forum thread, which could be translated to:

Nice client, but it will probably not keep you connected when inactive, "thanks" to Androids memory management

Is this true? Could it be a problem with Android itself and not this particular XMPP app? How can this be fixed? The XMPP status should stay at "Away" (and not disconnect&reconnect again and again) when the smartphone is inactive.

1
  • 1
    I guess that's a question of configuration. As you refer to German, look out for "WLAN Standby Richtlinie". In Settings -> WiFi, press "menu" to get to the advanced settings. Check how WiFi is configured to work when the screen is switched of. Probably it's set to "go to sleep". // Please add a comment here after you checked -- so if this was helpful, I might convert it to a (more detailed) answer for you and other affected users :)
    – Izzy
    Jan 18, 2013 at 10:16

1 Answer 1

1

About the statement

The quoted statement is just plain wrong. Android (or it's memory management component) does not prevent any app from keeping a stable connection to any kind of network service (e.g. XMPP).

You only have to deal with fact that Android will kill your process if it's under memory pressure. But the same manager that did kill your service (ActivityManager) will also restart your service once the low memory situation is resolved. Your app simply has to reconnect then.

As this will only happen when no Activity from the App is in foreground, the user usually doesn't notice the reconnection, or he/she simply doesn't care, since the App is in background anyways.

Your symptoms

Obviously Jabiru does reconnect. And I also think that jabiru doesn't disconnect intentionally. It's more likely that the data connection went down. The most probable reason for this is that the WiFi went to sleep. But then the GSM connection should take over and we would only see **one* disconnect after around 15 minutes.

I think you should look in the Android log to find out what happens around the time Jabiru disconnects. The WiFi sleep policy is one reason to look at, but then I wonder why Jabiru is able to reconnect at all, since the WiFi should be disabled until the device is woken up again.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .