iPhone 电池容量值(mAH)

发布于 2024-12-29 21:49:21 字数 101 浏览 2 评论 0原文

我想知道如何获得 iPhone/iPad 电池的 Mha 数据容量。 我会将它们放入我打算放在 appstore 上的应用程序中,然后我就无法使用 IOKit。 有谁知道我如何获得这些值?

I would like to know how to have the data capacity in Mha for iPhone/iPad battery.
I would put them in an application that I intend to put on appstore and then I can not use IOKit.
Does anyone know how I can get these values?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

爱格式化 2025-01-05 21:49:21
batteryLevel

The battery charge level for the device.
@property (nonatomic, readonly) float batteryLevel
Discussion

Battery level ranges from 0.0 (fully discharged) to 1.0 (100% charged). Before accessing this property, ensure that battery monitoring is enabled.

If battery monitoring is not enabled, battery state is UIDeviceBatteryStateUnknown and the value of this property is –1.0.
Availability

    Available in iOS 3.0 and later.

See Also

      @property batteryState
      @property batteryMonitoringEnabled

Declared In
UIDevice.h

来自 UIDevice 类参考

然后您可以向您的应用程序添加一个 plist,其中您将放置每个设备的所有电池容量,读取设备型号以及电池和充满电的百分比您可以获得以 mAH 为单位的实际容量值。

batteryLevel

The battery charge level for the device.
@property (nonatomic, readonly) float batteryLevel
Discussion

Battery level ranges from 0.0 (fully discharged) to 1.0 (100% charged). Before accessing this property, ensure that battery monitoring is enabled.

If battery monitoring is not enabled, battery state is UIDeviceBatteryStateUnknown and the value of this property is –1.0.
Availability

    Available in iOS 3.0 and later.

See Also

      @property batteryState
      @property batteryMonitoringEnabled

Declared In
UIDevice.h

From UIDevice Class Reference

An then you can add to your app an plist where you will put all battery capacity for every device, read device model and with the percentange of battery and full capacity you can get the actual value in mAH.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文