Hi cullona, I know about that class, but don't see anything that could be actually useful in it (I really don't need to know if the device is plugged in etc).
Hi Dianne, I know the general rules, but right know I would like to distinguish between some of the methods I have developed to achieve my goals. I'm doing a bit of a research on Android phone and right now I have 4 methods to achieve one of my research goals, I know more or less how precise each one is and even which one consumes more battery, but I don't know the precise consumption numbers. Let's say the best method consumes 100%, if the second method consumes only 25% and achieves 80% accuracy, it's better to use that one etc. I'm looking at the dump right now and it seems kinda hard to get overall picture from it, but I might try and see. Thanks for your replies. Best regards, Filip Havlicek 2011/1/19 Dianne Hackborn <[email protected]> > The only way to really know how much battery is being used is to have > hardware that measures actual current during various operations in your app. > > And that tells you about battery use for *that* device, which can have > fairly different characteristics from another device. > > So I would suggest that instead of getting lost in such details, you look > at the general rules that people write about how to reduce battery use -- > hold wake locks as little as possible, use the CPU as little as possible, > etc. > > You can find out these kinds of details about your app with "adb shell > dumpsys batteryinfo". > > On Wed, Jan 19, 2011 at 12:21 PM, Filip Havlicek <[email protected] > > wrote: > >> Hi everyone, >> >> I have come to the point where I would like to optimize my application to >> consume as less power as possible. I tried to search for some battery API or >> something I could use to measure how much my application drains the battery >> when it's running, but didn't find anything. I thought I could get at least >> the Settings - About phone - Battery use stats, but couldn't even find those >> values. Does anyone have some idea about this? Apart from buying some >> specialized hardware to connect the phone to (already saw that and don't >> want to pay hundreds of bucks for that kind of device). >> >> Thank you for all your replies. >> Best regards, >> Filip Havlicek >> -- >> You received this message because you are subscribed to the Google >> Groups "Android Developers" group. >> To post to this group, send email to [email protected] >> To unsubscribe from this group, send email to >> [email protected]<android-developers%[email protected]> >> For more options, visit this group at >> http://groups.google.com/group/android-developers?hl=en > > > > > -- > Dianne Hackborn > Android framework engineer > [email protected] > > Note: please don't send private questions to me, as I don't have time to > provide private support, and so won't reply to such e-mails. All such > questions should be posted on public forums, where I and others can see and > answer them. > > -- > You received this message because you are subscribed to the Google > Groups "Android Developers" group. > To post to this group, send email to [email protected] > To unsubscribe from this group, send email to > [email protected]<android-developers%[email protected]> > For more options, visit this group at > http://groups.google.com/group/android-developers?hl=en -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en

