开发者

iPhone Application: Best Practices for Minimizing Battery Usage?

What are the major factors that might cause an appli开发者_C百科cation to consume more battery power?

As an iPhone app developer, what best practices can I apply to minimize battery use?


  1. Minimise CPU usage.
  2. Use a profiler to find hot-spots in your code. Unlike desktop apps, where the goal is "fast enough," here, the goal is, "as little CPU as is humanly possible."
  3. Read up on background operation, because the way your app behaves in the background can have a significant effect on battery life.
  4. Avoid telling the app not to sleep via UIApplication.idleTimerDisable. If you need to use it, turn it on an off as a appropriate, rather than disabling it once at application startup time.
  5. Try to only keep OpenGL render loops running if the scene is changing.
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜