September 17, 2014
Hot Topics:
RSS RSS feed Download our iPhone app

Android Power Management Tips for Developers, Page 2

  • February 16, 2011
  • By Lauren Darcey & Shane Conder
  • Send Email »
  • More Articles »

Building Power-efficient Android Apps

Here are some additional tips for you, the Android developer, to ensure your applications make efficient use of the battery life on a target device:

 

 

  • Follow Android Best Practices, and Coding Standards in General--Acquire resources late, release early, etc. Design responsive, responsible applications. When using power-consuming features, like sensors, graphics, animations, Flash, etc, consider how these features will affect device power consumption.
  •  

     

  • Include Configurable Update Intervals--Many network-driven applications must check application servers routinely for new data. Make sure the intervals at which your application makes such checks is reasonable (not too short) and configurable. Consider adding time windows when updates should occur (e.g. overnight when the device is likely plugged in).
  •  

     

  • Be a Good Service Manager--If your application requires a service to be enabled, make sure you return it to the state in which you found it. For example, if your application turns on Bluetooth services, make sure to turn them back off when your application is finished.
  •  

     

  • Use Shared Messaging Technologies--While you could develop your own polling or PUSH-style messaging queues, using shared technologies like Cloud-To-Device Messaging (C2DM) rely upon a shared message queue, which eliminates the need for your application to provide its own persistent services. Instead, your app can sleep until the shared service used by C2DM wakes your app up. The more apps the user installs, the more important this becomes.
  •  

  • Provide Mobile Versions of Websites- Provide your users with the features they need, in a form that is optimized for mobile transmission and rendering.
  •  

     


    Visit the Android Dev Center

     

    Improve Your Device's Battery Life

    Hopefully these tips will help you to get more time out of your device battery. Android devices, and mobile platforms in general, are ever-evolving. By disabling features you don't use, getting creative with your charging opportunities, and leveraging some of the tips here, you should be able to improve your device's battery life substantially, as well as ensure that your own applications are "power-saving" and not "power-sucking."

    About the Authors

    Shane Conder Shane Conder and Lauren Darcey -- Contributing Editors, Mobile Development -- have coauthored two books on Android development: an in-depth programming book entitled Android Wireless Application Development (ISBN-13: 978-0-321-62709-4) and Sams Teach Yourself Android Application Development in 24 Hours (ISBN-13: 978-0-321-67335-0). When not writing, they spend their time developing mobile software at their company and providing consulting services.

             Email          |          Blog          |          Twitter          

    Lauren Darcey

    Tags: Android

    Originally published on http://www.developer.com.

    Page 2 of 2



    Comment and Contribute

     


    (Maximum characters: 1200). You have characters left.

     

     


    Sitemap | Contact Us

    Rocket Fuel