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.
我已经看到一些应用程序显示电池消耗的 mV/小时量。有没有办法检索该信息?还是那些程序定期读取 ACTION_BATTERY_CHANGED 意图,记录电压水平并计算梯度?
获取电池信息
private BroadcastReceiver mBatInfoReceiver = new BroadcastReceiver() { @Override public void onReceive(Context arg0, Intent intent) { int level = intent.getIntExtra("level", 0); System.out.println("battery level" + level); } };