如何找到Android手机的电池充电时间编程? [英] How to find the battery recharge time of android mobile programatically?

查看:250
本文介绍了如何找到Android手机的电池充电时间编程?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想知道我们怎样才能找到Android设备将需要多长时间到电池充满电。

I wanted to know that how can we find how much time android device will take to fully charge its battery.

例如,如果我的电池为0%,那么充电需要多长时间充饱即100%,同样的,如果我的设备是充到70%,所以如果我现在连接充电器再怎么长,将采取全面负责我的设备

For example if my battery is 0% charged then how long it will take to charge full i.e. 100%, same if my device is 70% charge so if i connect charger now then how long it will take to full charge my device.

推荐答案

您应该阅读的这个官方文档。基本上,你需要使用 BatteryManager 类,找出电池电量的当前状态。

You should read the official documentation about this. Basically you'll need to use BatteryManager class to find out current state of battery level.

这篇关于如何找到Android手机的电池充电时间编程?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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