如何在Android中计算传感器功耗 [英] How to calculate sensor power consumption in Android

查看:42
本文介绍了如何在Android中计算传感器功耗的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

getPower()返回幂传感器在使用中的最大电流:

getPower() returns the power in mA used by a sensor while in use:

现在,我需要计算传感器的定位消耗了多少电量.

Now, I need to calculate how much battery is used by the registration of the sensor.

getPower()返回的值是否表示mAH(每小时的mA)或其他值? 如果是,是否有办法获取电池mAH,以计算传感器使用的电池百分比?

Does he value returned by getPower() indicate the mAH (mA per HOUR) or something else? If yes, is there a way to get the battery mAH in order to calculate the % of battery used by the sensor?

推荐答案

不久前,Google小组中已经讨论了一些非常相关的问题.您可以在此处找到全线程以供参考.

Something quite related has been discussed in Google groups not too long ago. You can find the full thread here for reference.

该线程中最后一个答复的摘录,应该或多或少地回答您的问题:

A small excerpt from the last reply in that thread, which should answer your question more or less:

(...)电池容量始终以mAH为单位. (...) 什么 重要的是电池可以在多长时间内提供给定电流 额定电压. 3800mAH表示它可以提供1小时的3800mA电流. 知道了这一点,现在API提供了最新的 消耗作为功耗指标.您现在可以计算出多少 对电池寿命的影响是时间的函数.

(...) the battery capacity is always given in terms of mAH. (...) What matters is how long a battery can supply a given current at its rated voltage. 3800mAH means that it can supply 3800mA for 1 hour. Knowing this it makes sense now that the API is providing the current drain as a metric of power consumption. You can now calculate how much effect it will have on the battery life as a function of time.

这篇关于如何在Android中计算传感器功耗的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆