开发者

How to get an estimated amount of talktime,music/video playback time, idletime that could be possibly done based on the current level of battery left

I am working on the amazing android platform. I am creating an app which deals with the phone's battery level.I am showing the current battery level of the phone, along with few other technical things.I wanted to get an estimated amount of talktime,music/video playback time, idletime that could be possibly done based on the current level of battery left on the phone.Using this the user can get an idea that if his battery level is at 开发者_开发百科50% then possibly he can do another 2 hours of call talk (or) listen to 1 hour of music (or) if the phone is untouched then it would last for some 4 hours. In this way it would help the user.Please help me in suggesting an approach (or) is there any API available for this.?


Can't say for sure, but I highly doubt there would be any API for this.

I think the only workable approach is for you to collect data and try to estimate as close as possible. You can try to measure how much power each app / usage draws and also try to measure battery capacity. You'd have to tweak your values from time to time as batteries which are not new sometimes drop their voltage, etc so it's a moving target.


I think this is impossible to do.

As @dain suggests you could tray and measure historical data and make a guesstimation based on that, but as all sorts of background processes (connection strength low means lot of searching, wifi or not, data in the background, new applications, you name it) have influence on this, so it's hard to be accurate based on the collected data.

You might be able to target specific processes (like calling, or using a specific app like a music player), and check how much power they use on average, and go from there.

What sollution you use, I think because of the difference in all the data you will get some sort of mean out of it that would probably not be correct for the current situation. You might get away with a "minimum" vs "maximum" time per activity?


final Intent intent = new Intent(Intent.ACTION_MAIN, null); intent.addCategory(Intent.CATEGORY_LAUNCHER); final ComponentName cn = new ComponentName("com.android.settings", "com.android.settings.fuelgauge.PowerUsageSummary");
intent.setComponent(cn);
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); startActivity( intent);

this works for me

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜