iPhone/iPadのバッテリーのデータ容量をMhaにする方法を教えてください。アプリストアに置く予定のアプリケーションにそれらを入れると、IOKitを使用できなくなります。これらの値を取得する方法を知っている人はいますか?
1 に答える
2
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 で取得できます。
于 2012-01-30T10:02:22.560 に答える