Estimated battery life on iOS

Possible duplicate:
iphone: calculating battery life

I saw many applications in the appstore, which provides estimated battery life for different usage patterns (standby mode, audio and video playback, use of Wi-Fi and 3G browser, talk time). I have a similar requirement to calculate an estimated time like this. Can someone shed some light on how to do this programmatically?

+3
source share
1 answer

Battery life specifications come from the Apple website .

  • Talk time: up to 8 hours on 3G, up to 14 hours on 2G (GSM).
  • Standby time: up to 200 hours
  • Internet usage: up to 6 hours on a 3G network, up to 9 hours on Wi-Fi.
  • Video playback: up to 10 hours
  • Audio playback: up to 40 hours

Code to get the percentage of battery remaining:

[[UIDevice currentDevice] setBatteryMonitoringEnabled:YES]; float batteryLevel = [myDevice batteryLevel]; 

What all Apple and iOS give you, so all the app uses is guesswork.

+4
source

Source: https://habr.com/ru/post/972472/


All Articles