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