一直以来围绕android系统batterystats.bin这个文件来谈最精确的校正电量、完全恢复电量、提高使用时间等等的方法都被视为一个神话。这个文件到底有什么用?能不能像鼓吹的那么神奇?现在就来揭开它的神秘面纱。
由于这个文件并没有公布源码,以及民间也并未反编译成功,有些人就自以为是的认为它记录的是电池数据并由此展开丰富联想认为它有神圣的目的。对此google负责开发安卓系统的工程师Dianne Hackborn在其google+上曾专门说过下面一段话:
Today's myth debunking:"The battery indicator in the status/notification bar is a reflection of the batterystats.bin file in the data/system/ directory."No, it does not.This file is used to maintain, across reboots, low-level data about the kinds of operations the device and your apps are doing between battery changes. That is, it is solely used to compute the blame for battery usage shown in the "Battery Use" UI in settings.That is, it has deeply significant things like "app X held a wake lock for 2 minutes" and "the screen was on at 60% brightness for 10 minutes."It has no impact on the current battery level shown to you.It has no impact on your battery life.Deleting it is not going to do anything to make your more device more fantastic and wonderful... well, unless you have some deep hatred for seeing anything shown in the battery usage UI. And anyway, it is reset every time you unplug from power with a relatively full charge (thus why the battery usage UI data resets at that point), so this would be a much easier way to make it go away.
怎么理解这段话?他明确表示:这个betterystats.bin文件仅仅是一个记录不同app使用电量的一个文件。也就是说,它的作用仅仅是让你点击 设置-电池 看到的那个画面!当你充满电以后拔掉充电器,系统会自动删除/重置这个文件以便重新记录各个app的电量使用情况。与电池电量和寿命没有任何关系!
轻功好的或者爬墙高手到下面的参考资料链接自行查看!