Possible Duplicate:
iphone: Calculating battery life
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?