Mobile phone power consumption is mainly caused by some parts of the mobile phone, such as CPU, WiFi, GPS and so on. So the power consumption is mainly concentrated in the app upload, download data, check location, Wake lock screen and so on.
Now a little more detail to understand how these power consumption: 1. WiFi (Cellular wireless): When the WiFi is turned on, in order to let the hardware put into use, (1) There will be a wake-up power consumption peak, (2) The next is to send a packet consumption of electricity, (3) and then receive the packet also requires a lot of power, (4) after the completion of the work, the hardware will be Prevent packets from being received in a short period of time. As shown in the following:
650) this.width=650; "Src=" Http://s5.51cto.com/wyfs02/M01/86/77/wKiom1e_sHbDkOqvAANhrL9fUFI923.png-wh_500x0-wm_3 -wmp_4-s_2760336554.png "title=" 1.png "alt=" Wkiom1e_shbdkoqvaanhrl9fufi923.png-wh_50 "/>
2. Lock screen Wakeup: When unlocking the screen, you will see a big gain in power consumption. Turn on the LEDs, the GPU draws the entire screen, and the CPU starts to work. As shown in the following:
650) this.width=650; "Src=" Http://s4.51cto.com/wyfs02/M02/86/77/wKiom1e_s66yU06KAAFY1nbNgoY917.png-wh_500x0-wm_3 -wmp_4-s_3497171566.png "title=" 2.png "alt=" Wkiom1e_s66yu06kaafy1nbngoy917.png-wh_50 "/>
Of course, this is not the same as the phone's own application wake, applications such as: Alarmmanager, wake-up power consumption is only a small peak.
The following measures are currently taken to test how to measure the power consumption of the app as a result of the above problems:
1. Through the mobile phone system comes with the power calculation tool, horizontal comparison and the same kind of application of electricity consumption, vertical comparison of all the applications in the mobile phone consumption of high and low (do not rank in the first few);
2. This tool is then analyzed in detail by battery historian. (See http://www.cnblogs.com/jytian/p/5647798.html http://blog.csdn.net/itfootball/article/details/44084159)
Of course, for what kind of way to carry out the above test. There are two methods currently in use:
1. Set a few time periods to continuously trigger large power consumption within the app
2. Use monkey to make apps free
App Battery relative special test