8 ms·
Battery Optimization for Android Apps
- dkopi 12y agoI really hope Google one day adds a "battery usage" and "network usage" rating for apps in the play store. Common users are pretty helpless when it comes to figuring out which apps are killing their phone.
- kec 12y agoOne other thing this deck doesn't go into but has a huge impact (for games at least) is frame rate. Higher frame rates require the GPU to get the work done in a shorter amount of time and make it less likely that the GPU will be able to switch to an idle power save state. A good example of this in action is the game Threes. The developers implemented a "power save" feature in the game which simply cuts the frame rate in half[0], causing the app to consume noticeably less battery. 0: http://asherv.com/threes/support/ http://asherv.com/threes/support/
- corysama 12y agoI worked on a mobile FPS that was able to run at full-rez, 60fps on an iPad3. Unfortunately, doing so drained the battery faster than the wall charger could refill it! So, we shipped locked at 30fps and provided a "battery hog mode" option to the user.
- snuxoll 12y agoWhat level was the battery at? Past 80% most Lithium Ion or Lithium Polymer battery controllers will change to a trickle charge which could explain it.
- corysama 12y agoYou could drain the battery completely while charging.
- voltagex_ 12y agoIngress will do this on a Nexus 5 - except for wall chargers that are delivering the full ~1.7A (which are very very very few)
- fixedd 12y agoIngress can do this on a Galaxy Nexus with a 2A external battery pack (or, ya know, car). I was only able to help with about 1/2 of an Interitus event cause my phone kept dying and I'd have to wait a bit to bring it back online. I hate my phone.
- zxcvgm 12y agoI thought this slide deck would cover the improvements introduced by Project Volta [1] in Lollipop. They introduced a JobScheduler API that developers can use to perform the batching that he described, as well as the Battery Historian for better power profiling. [1] https://developer.android.com/about/versions/android-5.0.html#Power https://developer.android.com/about/versions/android-5.0.htm...
- christop 12y agoOn that topic, this is a much better talk: http://commonsware.com/presos/8469_Murphy.pdf http://commonsware.com/presos/8469_Murphy.pdf
- yardie 12y agoWhy is any of this even necessary at this stage. Android has been around for 7 years, 5 major versions, and many more subversions. Power management should be solved by now. The OS should be managing this. All power management options should be applied to all apps and only those that need an exemption should code around it.
- joshvm 12y agoIn my experience there are two drains on power: - The screen. Doesn't matter what the app is, if the screen is on the battery plummets - Network hunting. If there's no WiFi, but the radio is on then it wastes loads of battery trying to find a network.
- fixedd 12y agoDon't forget GPS... GPS lock murders.
- corysama 12y agoBecause apps are commonly requesting that the device perform actions that require excessive amounts of power according to the laws of physics. Can you imagine the complaints the OS devs would get if they stepped in to intervene? "I noticed your app made a separate request to the ad server every 30 seconds (between menus). So, I decided to batch up your requests and only send them every 10 minutes."
- cryptoz 12y agoIt's a balancing act between giving devs power over their code and managing battery. You could say that Apple 'solved' the problem by preventing developers from doing really cool things, whereas Google/Android still have battery concerns but devs have built awesome apps that depend on that flexibility. This isn't something than can be 'solved'. All the time, Google will make improvements to the OS (like JobScheduler in Lollipop) and devs will get better at managing their resources. Slowly we'll all get better battery performance. I make PressureNet, which runs in the background on Android in 10-minute intervals to get GPS, barometer measurement, and network lock. Maintaining a good battery life isn't easy, but it is possible. https://play.google.com/store/apps/details?id=ca.cumulonimbus.barometernetwork https://play.google.com/store/apps/details?id=ca.cumulonimbu...
- joosters 12y agoAn ad/tracker/stats blocker sounds like it might give your battery life a huge boost here. Think of the network traffic saved!
- voltagex_ 12y agoAlso https://developer.android.com/training/monitoring-device-state/index.html https://developer.android.com/training/monitoring-device-sta...