官术网_书友最值得收藏!

Understanding basic battery drain

Earlier editions of Android OS used to run on Dalvik Runtime, which means apps used to compile at execution time. Post-Lollipop edition, Android has switched to Android runtime (ART), which means the apps are compiled beforehand, ensuring they are launched faster. ART, as the runtime, executes the Dalvik Executable format and dex bytecode specification. Apart from the launch, the entire consumer experience using the app is essential for app retention. One important feature is the battery - a dear feature of the phone.

An app which is greedy for power often finds itself in the position of either being uninstalled or lower rated when reviewed on the Google Play Store listing. Take a look at some of the most popular apps on the Store, including Facebook, which has had consistently bad reviews that quote battery drain as one of the top sources of user dissatisfaction. If your app has the reputation of being a battery hog, that might incur a loss of potential users that could otherwise be using the app. Android developers usually neglect the way that their app could impact the battery life of the smartphone. Not that it needs deeper insights in embedded systems, but a few tips can help you to appreciate the impact of an app on battery life.

The battery is part of the user's experience.

If your app is one of the top drainers of the battery in the device, what's the best way to figure it out? The battery setting menu has an information resource to diagnose battery drain issues caused by mobile apps. Simply heading to Settings | Battery will provide the user with the necessary information in a graphical format, comparing consumption against time. The records are maintained since the last full charge status. There is also an interesting statistical overview of the applications that have contributed to battery drain:

Clicking on the graphs opens an extended section that shows how much time your device has spent in various cellular states. The different color patterns such as green, yellow, and orange indicate the signal strength. It also provides other information like active time using Wi-Fi, Device Awake time, and Screen On time.

A key observation you should make as a developer is of the state when your device is awake but the screen is off. This might be the result of a Wakelock or alarm that uses the device resources when the user might not be actively using the device. If this is frequently seen, it calls for some optimization. We will be talking about the Wakelocks and their impacts during the performance section of this book.

主站蜘蛛池模板: 建德市| 平罗县| 天气| 四会市| 志丹县| 左贡县| 延津县| 滕州市| 尚志市| 洛川县| 金湖县| 凉城县| 察雅县| 孙吴县| 辛集市| 玉林市| 浦东新区| 黄陵县| 绍兴市| 青海省| 连云港市| 乌鲁木齐市| 阳山县| 昂仁县| 旅游| 乌拉特中旗| 郁南县| 淅川县| 汝城县| 福泉市| 彭山县| 合阳县| 洛扎县| 利川市| 莱阳市| 灵丘县| 赤峰市| 巍山| 巴楚县| 博湖县| 阳东县|