android Power Management, Sleep mode, etc [closed]

て烟熏妆下的殇ゞ 提交于 2019-12-04 16:59:16

when will this happen?

Sometime after the screen turns off, based on user settings for inactivity.

CPU is going to sleep and my threads are suspend?

Yes.

when will this happen?

You asked that already.

To prevent CPU sleeping I can use PARTIAL_WAKE wake lock or alarm manager?

AlarmManager can cause the phone to wake up out of sleep mode, but only very briefly. A WakeLock prevents the device from going into sleep mode in the first place.

How prevent shutdown of WiFi and 3G connection in sleep mode programmatically from my app?

Use a WifiLock to prevent the WiFi radio from shutting down. The telephony radio is unaffected by sleep mode.

How the best way to achieve this?

If the user is not actively using the device, allow the connection to terminate. By definition, they are not participating in the IM session if their device falls asleep.

I know about C2DM framework

This has been replaced by GCM, which has the same basic characteristics.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!