If the wifi radio is disabled when the phone goes to sleep, then how does the e-mail app sync? Does it mean that the e-mail app holds a wifi lock?
On Friday, March 30, 2012 8:38:23 AM UTC+5:30, Put_tiMe wrote: > What about this situation:: > > 1. I set an AlarmManager to wake up every 15 minutes. > 2. I switch off the screen, and the phone goes to sleep in a few minutes. > 3. After 15 mins, the alarm manager kicks in. > 4. In the alarm manager handler code, can I take a wifi lock? Will this > work? > 5. Then after my job is done (in about 40 seconds) I'll release the wifi > lock. > > Does the above stategy look okay? > > > On Thursday, March 29, 2012 6:59:56 PM UTC+5:30, Mark Murphy (a Commons > Guy) wrote: > >> On Thu, Mar 29, 2012 at 9:02 AM, Put_tiMe <[email protected]> wrote: >> > I have a situation where in I use AlarmManager to wake up once in a few >> > minutes, and switch on/off wifi. >> > If I don't use the device for a while, then the wifi never connects to >> the >> > preferred wifi network. >> > Is there anything happening with the wifi if the phone is in a sleep >> state? >> >> The WiFi radio will power down. Use a WifiLock if you need WiFi. Bear >> in mind that this increases power drain. >> >> -- >> Mark Murphy (a Commons Guy) >> http://commonsware.com | http://github.com/commonsguy >> http://commonsware.com/blog | http://twitter.com/commonsguy >> >> Android Training in NYC: http://marakana.com/training/android/ >> >> -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en

