“每当谈及移动智能设备的瓶颈,大家首先想到的总是电池续航能力。电池续航时间不仅与设备的硬件有关,还与运行在设备中的应用程序紧密相关。
在电池自身容量无法在短时间内获得大幅提升的情况下,通过优化应用程序以节省电量的做法,也能在一定程序上起到延长电池续航时间的作用。同时,也让移动应用开发者对应用的耗电状况有了全新认识,或许省电也能成为应用的一种竞争力。”
为了让你的应用程序更好的存在于用户的设备中,限制程序对电池的影响是很有必要的。通过本文的学习,你创建的程序将可以根据用户设备的电池状态来改变功能或者行为。
为了降低你程序对电池续航时间的影响,同时不降低用户的用户体验,你可以采取如下的方式,比如当设备与互联网失去连接的时候就不应该让你的运行在后台的服务再自动更新,或者当用户设备的电池电量很低的时候,减少更新频率。
本文将根据官方的教程,来介绍一下如何让你的程序对电池有更少的影响,从而优化电池的续航时间。教程主要包括四个方面,分别是:
监听电池电量和电池的充电状态(MonitoringtheBatteryLevelandChargingState);
确定和监听Docking状态和类型(DeterminingandMonitoringtheDockingStateandType);
确定和监听联网状态(DeterminingandMonitoringtheConnectivityStatus)
管理广播接收者(ManipulatingBroadcastReceiversOnDemand)
分享到:
相关推荐
本书为使用英特尔流行的微处理器产品线的设备汇编了与Android应用程序开发相关的最佳实践和过程。
Android on x86: an Introduction to Optimizing for Intel® Architecture serves two main purposes. First, it makes the case for adapting your applications onto Intel’s x86 architecture, including ...
优化Flash性能 Optimizing Flash performance
Optimization of Bms design
[OPTIMIZING]OPTIMIZING_CPP
Optimizing parallel reduction in CUDA 规约优化文档
[OPTIMIZING]OPTIMIZING_ASSEMBLY
Build fast and efficient Android apps that run as reliably as clockwork in a multi-device ...Chapter 8: Optimizing Battery Consumption Chapter 9: Native Coding in Android Chapter 10: Performance Tips
optimizing C++ C++优化-英文版
Optimizing Aerodynamic Design Problems
Building an Optimizing Compiler Building an Optimizing Compiler Building an Optimizing Compiler
Securing And Optimizing Linux
Energy optimization of a battery-powered device Optimizing embedded applications for overall efficiency should be an integral part of the development process as it is important to understand how ...
为C ++程序员提供了一种实用的,实际的程序优化方法。
介绍了C++应用程序优化,以及处理器,编译器相关的知识,文中优化库链接可用,轻薄短小,内容丰富。
卫星图像目标探测的空间数据处理优化_Optimizing Data Processing in Space for Object Detection in Satellite Imagery.pdf
C++最全的提高性能指南,优化性能,简短程序运行时间
Optimizing Java Practical Techniques for Improved 完整版,不是early release
Optimizing Compilers for Modern Architectures.pdf