안드로이드에서 실제 배터리 전압을 얻기 위해 시스템 호출을 할 수있는 방법이 있습니까? 내가 원하는 은 다음과 같이 뭔가 수행배터리 전압 받기
double voltage = getVoltage();
//run code
double newVoltage = getVoltage();
감사
편집 - 근무 코드 :
public int getVoltage()
{
IntentFilter ifilter = new IntentFilter(Intent.ACTION_BATTERY_CHANGED);
Intent b = this.registerReceiver(null, ifilter);
return b.getIntExtra(BatteryManager.EXTRA_VOLTAGE, -1);
}