Energy Efficiency, Water Efficiency, and Renewable Energy Site ...
Energy efficiency of android
-
Upload
littleeye -
Category
Technology
-
view
1.257 -
download
3
description
Transcript of Energy efficiency of android
![Page 1: Energy efficiency of android](https://reader035.fdocuments.us/reader035/viewer/2022062419/5584c6d5d8b42af1138b48b4/html5/thumbnails/1.jpg)
Understanding Energy Efficiency of Android Apps
(and how to Improve it)
Aditya Kulkarni
![Page 2: Energy efficiency of android](https://reader035.fdocuments.us/reader035/viewer/2022062419/5584c6d5d8b42af1138b48b4/html5/thumbnails/2.jpg)
Apps are to blame the most for bad battery life• Bad coding patterns
cause power bugs• Specific behaviors of the
Android Platform• App inter-dependencies!• Special Attention must
be paid to optimize for power!
![Page 3: Energy efficiency of android](https://reader035.fdocuments.us/reader035/viewer/2022062419/5584c6d5d8b42af1138b48b4/html5/thumbnails/3.jpg)
Users Hate “Power Bugs”
![Page 4: Energy efficiency of android](https://reader035.fdocuments.us/reader035/viewer/2022062419/5584c6d5d8b42af1138b48b4/html5/thumbnails/4.jpg)
Energy Consumption of An Android Phone
![Page 5: Energy efficiency of android](https://reader035.fdocuments.us/reader035/viewer/2022062419/5584c6d5d8b42af1138b48b4/html5/thumbnails/5.jpg)
Understanding Power Bugs
![Page 6: Energy efficiency of android](https://reader035.fdocuments.us/reader035/viewer/2022062419/5584c6d5d8b42af1138b48b4/html5/thumbnails/6.jpg)
Screen• color matters!– esp on OLED screens– darker the color, lesser
the consumption• brightness levels have
more impact– refer to -
http://stackoverflow.com/questions/5032588/cant-apply-system-screen-brightness-programmatically-in-android
![Page 7: Energy efficiency of android](https://reader035.fdocuments.us/reader035/viewer/2022062419/5584c6d5d8b42af1138b48b4/html5/thumbnails/7.jpg)
Screen• programmatically
reduce brightness if its suits your app/activity
• Use “night mode” for reading Apps
• Think about your color scheme
![Page 8: Energy efficiency of android](https://reader035.fdocuments.us/reader035/viewer/2022062419/5584c6d5d8b42af1138b48b4/html5/thumbnails/8.jpg)
CPU• wakelocks are your friend,
but your users worst nightmare!
• use them only if really needed and ensure they are removed as soon as possible
• Use ‘android:keepScreenOn’ property in your manifest instead of doing it programmatically
![Page 9: Energy efficiency of android](https://reader035.fdocuments.us/reader035/viewer/2022062419/5584c6d5d8b42af1138b48b4/html5/thumbnails/9.jpg)
CPU• if possible, spread out your
computationally intensive job
• gpu typically consumes more power than cpu– avoid floating point math
where possible• use algorithms that
consume less CPU cycle– O(n log n) vs O(n 2)
algorithms
![Page 10: Energy efficiency of android](https://reader035.fdocuments.us/reader035/viewer/2022062419/5584c6d5d8b42af1138b48b4/html5/thumbnails/10.jpg)
Wireless Radios• 3G/4G LTE have tail
states and warm-up times
• Power States are controlled by the Carrier
• Batching, state checks are your friend!
![Page 11: Energy efficiency of android](https://reader035.fdocuments.us/reader035/viewer/2022062419/5584c6d5d8b42af1138b48b4/html5/thumbnails/11.jpg)
GPS and Location Services• GPS is fairly heavy• Getting a location fix is far
more expensive than maintaining a fix
• Registering for notifications can have cascading effects
• Use Play Services Location APIs
![Page 12: Energy efficiency of android](https://reader035.fdocuments.us/reader035/viewer/2022062419/5584c6d5d8b42af1138b48b4/html5/thumbnails/12.jpg)
Best Practices(or how to avoid the dreaded battery drain)
![Page 13: Energy efficiency of android](https://reader035.fdocuments.us/reader035/viewer/2022062419/5584c6d5d8b42af1138b48b4/html5/thumbnails/13.jpg)
Common Power Bugs 1. Not Sleeping Properly
![Page 14: Energy efficiency of android](https://reader035.fdocuments.us/reader035/viewer/2022062419/5584c6d5d8b42af1138b48b4/html5/thumbnails/14.jpg)
Common Power Bugs 2. Un-necessary Animations
![Page 15: Energy efficiency of android](https://reader035.fdocuments.us/reader035/viewer/2022062419/5584c6d5d8b42af1138b48b4/html5/thumbnails/15.jpg)
Common Power Bugs 3. Updating the Screen
![Page 16: Energy efficiency of android](https://reader035.fdocuments.us/reader035/viewer/2022062419/5584c6d5d8b42af1138b48b4/html5/thumbnails/16.jpg)
Common Power Bugs 4. Handling Display-Off
![Page 17: Energy efficiency of android](https://reader035.fdocuments.us/reader035/viewer/2022062419/5584c6d5d8b42af1138b48b4/html5/thumbnails/17.jpg)
Common Power Bugs 5. Waking up to notifications
![Page 18: Energy efficiency of android](https://reader035.fdocuments.us/reader035/viewer/2022062419/5584c6d5d8b42af1138b48b4/html5/thumbnails/18.jpg)
Use A Power Profiler Like Little Eye