5

I am making an app that quickly drains the users battery. For this, I am planning on using the sound-framework for vibrating, location services, download large but empty files from the internet, use the flashlight on the back of the phone, and so on. I know these can effectively drain the battery, but I would like to know if there are more methods that are more or equally power/processor-consuming or that could work for this in any way?

Examples on how to achieve 100% CPU usage is also very appreciated.

Thanks.

Srikar Appalaraju
  • 71,928
  • 54
  • 216
  • 264
Emil
  • 7,220
  • 17
  • 76
  • 135
  • It is meant as a helper for the recommended monthly battery cycle (fully drain then fully charge). – Emil Dec 31 '11 at 11:45
  • 1
    Let us know once that app is released, sounds helpful indeed. – Till Dec 31 '11 at 11:47
  • 1
    Will do ;) Click the favorite-button for a notification. – Emil Dec 31 '11 at 11:48
  • 4
    Lithium-Ion batteries are not like old-style NiCad or NiMH batteries. There is no "memory" effect and no need to periodically discharge them. In fact, completely discharging a lithium-ion battery will probably kill it, so most of them have circuitry to prevent that. – Ferruccio Dec 31 '11 at 13:39
  • 1
    +1 @Ferruccio. Where is this drain/recharge cycle "recommended"? – jrturton Dec 31 '11 at 18:40
  • 1
    Yes -- where is this monthly drain/recharge cycle recommended? If it is on an apple.com piece of documentation, please post the link. – bbum Dec 31 '11 at 19:53
  • 2
    @Ferruccio and @jrturton `Use iPhone Regularly For proper maintenance of a lithium-based battery, it’s important to keep the electrons in it moving occasionally. Be sure to go through at least one charge cycle per month (charging the battery to 100% and then completely running it down).` from http://www.apple.com/batteries/iphone.html – Till Jan 02 '12 at 00:01
  • 1
    @Till: `Lithium polymer batteries cannot be deep discharged. Once they are deep-discharged, they can be damaged and cannot be charged to their normal capacity. ` - http://en.wikipedia.org/wiki/Lithium-ion_polymer_battery. `Low Maintenance - no periodic discharge is needed; there is no memory.` - http://batteryuniversity.com/learn/article/is_lithium_ion_the_ideal_battery - and, on the same page, comparing lithium-ion-polymer (which Apple uses) to lithium-ion - `Lower energy density and decreased cycle count compared to lithium-ion` – Ferruccio Jan 04 '12 at 14:56
  • 1
    @Ferruccio I totally believe those fact you are quoting. However, as you see, Apple does recommend this handling and since some of you were asking for a link / proof, I simply delivered. Personally, I believe what Apple actually meant to explain is the case of an unused device - not permanent use. – Till Jan 04 '12 at 15:59

1 Answers1

7

Here are some of the things you could do (Most of these are possible to do programatically. i.e. they can all be turned on one by one as soon as your app starts) -

  1. Turn on System Services (Not sure this is possible programmatically)
  2. Turn on Location Services. i.e. GPS-Based Time Zone Detection & Others with max. update frequency & keep moving the phone around to get GPS working.
  3. Turn on Push notifications with minimum of 15 minute interval.
  4. Turn on iCloud support.
  5. Turn on Notifications.
  6. Make screen brightness highest & Set the iPhone not to lock.
  7. Turn on AirPlay (one of the fastest ways I have seen battery drain).
  8. Turn on the 3G, Wi-Fi radios.
  9. Turn on Bluetooth radios & connect to a headset.
  10. Play music through built-in speaker.
  11. Use maps in your app & turn on the “Locate Me” feature using GPS. Leave the iPhone to it.
  12. Try to get 100% CPU usage (as suggested by Matthias). But be careful, lest watchDog will shut your app down without second thought.
  13. Do some OpenGL rendering (as suggested by Matthias).
  14. Turn on your Camera LED & keep it on.
  15. Turn on all sensors in your device. Accelerometer, Gyroscope & set it so that your app receives maximum updates i.e. keep the update intervals shortest possible & move the phone around.

Most likely the battery will drain within 2 hours.

One suggested way for you to achieve 100% CPU usage using threading - Background threads consuming 100% CPU on iPhone 3GS causes latent main thread. But be careful...

Community
  • 1
  • 1
Srikar Appalaraju
  • 71,928
  • 54
  • 216
  • 264
  • 3
    there are two things that will probably drain your battery faster than those 8: 100% CPU usage and OpenGL. – Matthias Bauch Dec 31 '11 at 11:47
  • 100% CPU usage indeed should be the bomb - but make sure you stay nice to the OS to prevent getting shutdown while being unresponsive. – Till Dec 31 '11 at 11:49
  • there is a catch to 100% CPU usage. Apple has a internal service called watchdog which will kill your app if its taking up too much system resources. So be careful. – Srikar Appalaraju Dec 31 '11 at 11:51
  • This is my accepted answer, I'm just waiting to see if there are more answers. Thanks! :) – Emil Dec 31 '11 at 12:01
  • 1
    I'll just add my answer here. Since you have some free space, calculate Pi to the nth digit. – Sum Dec 31 '11 at 18:30