문제

I'm reading out several values using the BatteryManager including voltage

int volt = intent.getIntExtra(BatteryManager.EXTRA_VOLTAGE, -1);

The problem is, that some devices return mV and others V (e.g. 5122 and 5).

Question: Is there a way to retrieve the order of magnitude or do I have to implement manual plausibility checks?

thanks

도움이 되었습니까?

해결책

IMHO such a "scale" indicator only exists for the battery level (see http://developer.android.com/reference/android/os/BatteryManager.html) not for the voltage. Usually mV should be returned - but to be on the safe side you will need to do a plausibility check

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top