找回密码
 立即注册
androidtheinternalThis | 技术管理 2022-05-11 369 0star收藏 版权: . 保留作者信息 . 禁止商业使用 . 禁止修改作品
本Demo是对2.3.3的settings源码的修改,主要针对没有研究过这部分源码的同学。
设置中获取手机电池电量排名的原理主要是通过读取电池记录文件来实现的。主要使用隐藏类android.os.BatteryStats和特殊包com.android.internal。
隐藏类很容易解决,主要是内部包。这个包不仅不在android.jar中,而且如果你找到这个包,放到android.jar中,你会发现它是没有用的。原因是 ADT 对这个包施加了限制。不允许使用。
一种解决方案是修改 ADT 以消除此限制。
另一种是不要把internal放在android.jar中,单独作为包导入到项目中,这样就不会受到限制。

(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.)

[下载]12175640149.rar




上一篇:SenSys147-co-gps.pdf
下一篇:获取程序耗电排行-Android开发进阶