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

后端 未结 1 1841
南旧
南旧 2021-02-06 13:42

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 f

1条回答
  •  后悔当初
    2021-02-06 14:28

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

    0 讨论(0)
提交回复
热议问题