Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What are the most battery-consuming things you can do in an iPhone-app?

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.

like image 916
Emil Avatar asked Dec 31 '11 11:12

Emil


1 Answers

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...

like image 64
Srikar Appalaraju Avatar answered Oct 28 '22 20:10

Srikar Appalaraju