Quantcast
Channel: Ignite Realtime: Message List
Viewing all articles
Browse latest Browse all 12162

Re: Persistent connection

$
0
0

Wakelooks, preventing the phone from sleeping are obviously a bad idea, if you don't want to build a battery draining app.

 

I can only point to MAXS Transport XMPP as reference implementation how a persistent connection is done correctly.

 

Standard Android implementations do not turn off Wifi when the device get's into sleep. But this can vary between manufactures and (custom) ROMs. I even have reports from (terrible IMHO) implementations that close the socket in certain situations.

 

When it comes to mobile XMPP, you will always have to make a tradeoff between battery consumption and connection stability. For example, sending a Ping every 10 seconds may assures that a broken connection is detected in a short timeframe, but the short inverall cause increased battery consumption, because the radio or WiFi adapter needs to become active and is prevent from going in power saving mode. That's why I would never recommend a ping interval lower then 15 minutes. In fact I recommend 30 minutes.

 

Since you didn't say why the conneciton when down, it's hard to give further advice.


Viewing all articles
Browse latest Browse all 12162

Trending Articles