There is a research paper called “Accurate Online Power Estimation and Automatic Battery Behavior Based Power Model Generation for Smartphones”. For this paper the researchers developed a tool called PowerTutor, the sources of which you can find here. It should be mentioned that your device has to be rooted to use this application.
http://web.eecs.umich.edu/~zmao/Papers/powertutor_cases2010.pdf
А это аппликация к статье PowerTutor:
https://github.com/msg555/PowerTutor