4

I am developing an android application and I want to reduce the power consumption. The method I believe is to put the phone into sleep mode whenever the user activity stops for a certain threshold period. I have three questions regarding this.

  1. If I release the wakeLock and no other application is holding the wakeLock after how much time would the phone go to sleep?

  2. I have multiple HandlerThreads running where I use sendMessageDelayed() function. Would these messages get delivered even after the phone goes to sleep mode?

  3. Does putting the phone into aeroplane mode save more power rather than just putting the phone to sleep. if yes, then why is it because the only difference in those two modes is the use of cellular network.

crazyaboutliv
  • 2,769
  • 9
  • 29
  • 47

1 Answers1

3

If I release the wakeLock and no other application is holding the wakeLock after how much time would the phone go to sleep?

There really is no definitive answer, but, from personal experience, I'd say it is likely that it will happen within 30 seconds to 1 minute.

I have multiple HandlerThreads running where I use sendMessageDelayed() function. Would these messages get delivered even after the phone goes to sleep mode?

I really wouldn't count on it because I've never seen anything that says it will wake up the device to send said Message. You can always test it, but I wouldn't trust it to work because the documentation does not claim that it will.

Does putting the phone into aeroplane mode save more power rather than just putting the phone to sleep. if yes, then why is it because the only difference in those two modes is the use of cellular network.

If you put it into sleep mode AND airplane mode, then you will save more battery than JUST sleep mode.

The reason for that is that even with the CPU pretty much asleep, the phone must keep a constant connection with the cellular network in order to know if you get a text or phone call. To do this, it must use the battery to constantly keep the antenna turned on. If you put it into airplane mode, it would basically turn the antenna off, and then the phone would not be using battery for that function.

Reed
  • 13,861
  • 6
  • 61
  • 102
  • Thanks Jakar. Could you please provide me the reference using which you answered question 2 and question 3? – crazyaboutliv Jan 27 '12 at 13:06
  • For question 3, I didn't use a reference. I just looked at it logically - if the phone has to keep something else powered, then it has to use more battery. For question 2, there isn't really documentation about sleep mode but I read over [this page](http://developer.android.com/reference/android/os/Handler.html) and it said nothing about waking up the device. The only thing that reliably wakes up the device is an `Alarm` set for a `BroadcastReceiver` with RTC_WAKEUP. – Reed Jan 27 '12 at 20:32
  • Good answer,It explains why sendMessageDelayed() not work when screen off. – Albert.Qing Feb 06 '13 at 08:42