(This demo is a modification of the settings source code of 2.3.3, mainly for students who have not studied this part of the source code.
The principle of obtaining the battery power ranking of mobile phone in setting is mainly realized by reading the battery record file. It mainly uses the hidden class Android os. Batterystats and special packages com android. internal。
Hidden classes are easy to solve, mainly internal packages. This package is not only not on Android Jar, and if you find this package, put it in Android Jar, you will find it useless. The reason is that ADT imposes restrictions on this package. Not allowed.
One solution is to modify the ADT to eliminate this limitation.
The other is not to put internal on Android Jar, which is imported into the project as a package separately, so it will not be restricted.)