你可以在iPhone应用程序中做什么最耗电的东西? [英] What are the most battery-consuming things you can do in an iPhone-app?

查看:174
本文介绍了你可以在iPhone应用程序中做什么最耗电的东西?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在开发一款能迅速耗尽用户电量的应用。为此,我计划使用声音框架进行振动,定位服务,从互联网上下载大而空的文件,使用手机背面的手电筒,等等。
我知道这些可以有效地耗尽电池,但是我想知道是否有更多或者同等功率/处理器消耗的方法或者可以以任何方式为此工作?

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?

如何实现100%CPU使用率的例子也非常受欢迎。

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

谢谢。

推荐答案

以下是你可以做的一些事情(其中大部分都可以以编程方式进行。也就是说,一旦你的应用程序启动,它们都可以一个接一个地打开) -

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. 打开系统服务(不确定这是否可以通过编程方式实现)

  2. 启用位置服务。即基于GPS的时区检测&其他人最多更新频率&继续移动手机以使GPS正常工作。

  3. 以最少15分钟的间隔打开推送通知。

  4. 打开iCloud支持。

  5. 打开通知。

  6. 使屏幕亮度最高&设置iPhone不要锁定。

  7. 打开AirPlay(我看到电池耗尽的最快方式之一)。

  8. 打开3G, Wi-Fi无线电。

  9. 打开蓝牙无线电&连接到耳机。

  10. 通过内置扬声器播放音乐。

  11. 在您的应用中使用地图&使用GPS打开定位我功能。将iPhone留给它。

  12. 尝试获得100%的CPU使用率(按照Matthias的建议)。但是要小心,以免watchDog在不经过深思熟虑的情况下关闭你的应用程序。

  13. 做一些OpenGL渲染(按照Matthias的建议)。

  14. 打开您的相机LED &保持打开状态。

  15. 打开设备中的所有传感器。加速度计,陀螺仪和设置它,以便您的应用程序接收最大更新,即保持更新间隔最短和&移动手机。

  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.

电池最有可能在2小时内耗尽。

Most likely the battery will drain within 2 hours.

使用线程实现100%CPU使用率的一种建议方法 - 在iPhone 3GS上消耗100%CPU的后台线程导致潜在的主线程。但要小心......

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

这篇关于你可以在iPhone应用程序中做什么最耗电的东西?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆