If this is some kind of instant messaging application, then keeping a WakeLock for a long time is probably not a good idea. Your users might like messages being delivered instantly, but dismayed that it only lasts a few hours.

You might want to schedule a wake-up alarm with AlarmManager, acquire locks for a period of time, display a notification, and if the user doesn't immediately start reading / responding, let the phone fall back to sleep.

-- Kostya

22.10.2010 16:24, Mark Murphy пишет:
On Fri, Oct 22, 2010 at 8:12 AM, Jey<jp9894562...@gmail.com>  wrote:
               is there any way to keep my connection alive when the
screen goes off ? my xmpp connection is disconnected due to
ACTION_SCREEN_OFF event,
If you are on WiFi, you would need to hold a WifiLock and probably a WakeLock.



--
Kostya Vasilyev -- WiFi Manager + pretty widget -- http://kmansoft.wordpress.com

--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to