Scott Main | 7736f96 | 2011-12-15 15:40:25 -0800 | [diff] [blame] | 1 | page.title=Optimizing Battery Life |
Scott Main | 1c2dea0 | 2013-04-10 18:59:29 -0700 | [diff] [blame] | 2 | page.tags="network","internet" |
Scott Main | 604e4ed | 2011-12-13 18:24:34 -0800 | [diff] [blame] | 3 | |
| 4 | trainingnavtop=true |
| 5 | startpage=true |
Scott Main | 604e4ed | 2011-12-13 18:24:34 -0800 | [diff] [blame] | 6 | |
| 7 | @jd:body |
| 8 | |
| 9 | <div id="tb-wrapper"> |
| 10 | <div id="tb"> |
| 11 | |
| 12 | <h2>Dependencies and prerequisites</h2> |
| 13 | <ul> |
| 14 | <li>Android 2.0 (API level 5) or higher</li> |
Scott Main | 50e990c | 2012-06-21 17:14:39 -0700 | [diff] [blame] | 15 | <li>Experience with <a href="{@docRoot}guide/components/intents-filters.html">Intents and Intent Filters</a></li> |
Scott Main | 604e4ed | 2011-12-13 18:24:34 -0800 | [diff] [blame] | 16 | </ul> |
| 17 | |
| 18 | <h2>You should also read</h2> |
| 19 | <ul> |
Scott Main | 50e990c | 2012-06-21 17:14:39 -0700 | [diff] [blame] | 20 | <li><a href="{@docRoot}guide/components/services.html">Services</a> |
Scott Main | 604e4ed | 2011-12-13 18:24:34 -0800 | [diff] [blame] | 21 | </ul> |
| 22 | |
| 23 | </div> |
| 24 | </div> |
| 25 | |
| 26 | <p>For your app to be a good citizen, it should seek to limit its impact on the battery life of its |
| 27 | host device. After this class you will be able to build apps that monitor modify their functionality |
| 28 | and behavior based on the state of the host device.</p> |
| 29 | |
| 30 | <p>By taking steps such as disabling background service updates when you lose connectivity, or |
| 31 | reducing the rate of such updates when the battery level is low, you can ensure that the impact of |
| 32 | your app on battery life is minimized, without compromising the user experience.</p> |
| 33 | |
| 34 | <h2>Lessons</h2> |
| 35 | |
| 36 | <!-- Create a list of the lessons in this class along with a short description of each lesson. |
| 37 | These should be short and to the point. It should be clear from reading the summary whether someone |
| 38 | will want to jump to a lesson or not.--> |
| 39 | |
| 40 | <dl> |
| 41 | <dt><b><a href="battery-monitoring.html">Monitoring the Battery Level and Charging State</a></b></dt> |
| 42 | <dd>Learn how to alter your app's update rate by determining, and monitoring, the current battery |
| 43 | level and changes in charging state.</dd> |
| 44 | |
| 45 | <dt><b><a href="docking-monitoring.html">Determining and Monitoring the Docking State and |
| 46 | Type</a></b></dt> |
| 47 | <dd>Optimal refresh rates can vary based on how the host device is being used. Learn how to |
| 48 | determine, and monitor, the docking state and type of dock being used to affect your app's |
| 49 | behavior.</dd> |
| 50 | |
| 51 | <dt><b><a href="connectivity-monitoring.html">Determining and Monitoring the Connectivity |
| 52 | Status</a></b></dt> |
| 53 | <dd>Without Internet connectivity you can't update your app from an online source. Learn how to |
| 54 | check the connectivity status to alter your background update rate. You'll also learn to check for |
| 55 | Wi-Fi or mobile connectivity before beginning high-bandwidth operations.</dd> |
| 56 | |
| 57 | <dt><b><a href="manifest-receivers.html">Manipulating Broadcast Receivers On Demand</a></b></dt> |
| 58 | <dd>Broadcast receivers that you've declared in the manifest can be toggled at runtime to disable |
| 59 | those that aren't necessary due to the current device state. Learn to improve |
| 60 | efficiency by toggling and cascading state change receivers and delay actions until the device is in |
| 61 | a specific state.</dd> |
| 62 | </dl> |