views:

28

answers:

1

What are the major factors that might cause an application to consume more battery power?

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

+1  A: 
  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.
Marcelo Cantos