本文介绍了估计iOS上的电池续航时间的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我在appstore看过很多应用它提供了不同使用模式(待机,音频和视频播放,Wi-Fi和3G浏览器使用,通话时间)的估计电池工作时间。我有类似的要求来计算这样的估计时间。有人可以通过编程方式了解如何进行此操作吗?
I have seen many apps in appstore which provides Estimated battery work time for different usage patterns (standby, audio and video playback, Wi-Fi and 3G browser usage, talk time). I have a similar requirement to compute the estimated time like this. Can someone throw some light on how to do this programmatically?
推荐答案
电池寿命规格来自。
- 通话时间:3G上最多8小时,2G上最多14小时(GSM)
- 待机时间:最长200小时
- 互联网使用:3G上最多6小时,Wi-Fi上最多9小时
- 视频播放:最多10小时
- 音频播放:最多40小时
- Talk time: Up to 8 hours on 3G, up to 14 hours on 2G (GSM)
- Standby time: Up to 200 hours
- Internet use: Up to 6 hours on 3G, up to 9 hours on Wi-Fi
- Video playback: Up to 10 hours
- Audio playback: Up to 40 hours
代码得到剩余电池的百分比是:
The code to get the percentage of battery left is:
[[UIDevice currentDevice] setBatteryMonitoringEnabled:YES];
float batteryLevel = [myDevice batteryLevel];
这都是Apple和iOS给你的,所以应用程序使用的任何东西都是猜测。
That's all Apple and the iOS give you, so anything else an app uses is guesswork.
这篇关于估计iOS上的电池续航时间的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!