Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我可以在 Android 设备中以编程方式切断电池充电吗?是否有 Root 访问权限?1
您可以尝试通过解析文件夹中的文件从PROC文件系统中读取信息
/sys/class/power_supply/battery/
现有文件应包括有关设备当前是充电还是放电、当前电压、可能是温度以及可能还有电流(安培数)的信息。但是,这些文件中的大多数是特定于设备的,刷新率可以从每秒一次 (1Hz) 到每分钟一次不等。