开发者

Voltage and Temperature readout - Order of Magnitude issue

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 开发者_C百科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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜