title: Battery time calculation
body: <p>I am wondering if there is any library for calculating remaining battery time on mobile devices like the iPhone, iPad, android phones etc? Or if there is any hope of doing any reasonable assumptions about battery usage depending on properties like:</p>
  
  <ul>
  <li>Screen brightness</li>
  <li>Radio usage (network, WIFI/3G/4G/bluetooth)</li>
  <li>User interaction level</li>
  <li>CPU utilization</li>
  </ul>
  
  <p>I am thinking that it might be possible to find out how these properties affect the battery life and in that way be able to develop some kind of library to be able to warn users about low battery levels when you know for how long the user will need to use the device.
  You could then:</p>
  
  <ul>
  <li>Ask the user to lower the screen brightness</li>
  <li>Ask the user to turn off WIFI/3G (or switch)</li>
  <li>Automatically lower the update polling frequency of any network operations</li>
  </ul>
  
  <p>I have a limited knowledge of physics and electronics, but it seems to me that it should be possible to do this? Ive googled and not found anything like this.</p>