Where does "battery usage" app collect its data from? The Battery Usage screen gives nice stats about which application has consumed how much battery. The stats are based on the time each process has kept the phone awake, the CPU time, etc. etc.

There are times that I want to get more details that possibly exist, but not shown in the UI. That's why I want to look at the source of the info, or possibly write an app to collect better stats. (maybe some files in the /proc file system?)

Originally, this is because I didn't get any answer on this question:
How can I find out what causes &quot;Android OS&quot; to consume battery?
I think you found a solution to your source problem. However your question went unanswered.

The information in the Battery Usage screen is found in

/data/system/batterystats.bin

https://plus.google.com/u/0/105051985738280261832/posts/FV3LVtdVxPT