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 设备在 stant t 时消耗的功率!
功率 (P) = 电压 (V) * 电流 (I)
我可以通过注册意图接收器以接收 ACTION_BATTERY_CHANGED 的广播来获取电池电压的值。但是问题是Android没有通过这个SDK接口暴露current的值。
获取电池当前值的任何建议/指针?如果我错了也请纠正我。
黛博拉
SDK 不支持它,但显然可以通过读取 I2C 总线上的一些值来完成。这是一个指向其来源的链接,该链接CurrentWidget找到了一种读取电流的方法。我似乎每个设备读取电流的方法都不同。
CurrentWidget
http://code.google.com/p/currentwidget/source/browse/trunk/CurrentWidgetLibrary/src/com/manor/currentwidget/library/CurrentReaderFactory.java
祝你好运!