Android Battery Graphing Source Code

Published @Sun, 24th Jan 2010
Early last year I wrote an application to graph the battery usage of my new Android G1 phone. It uploads the battery status to my server and then rrdtool is used to produce graphs from the data. See Google Phone Battery Usage Graphing for more details, including the graphs. I've had a couple of requests for access to the source code recently, so I've tarred it up and put it here for download.

Download Batmon.tgz (38kB)

The Android app "uploads" data to the server by doing HTTP requests. The tarball includes both the Java for the Android app, and the Perl CGI which does the graphing. I'm making the source available with no warranty of any kind, feel free to pick it apart and do with it as you like. If anything, it should be a good example of how to create persistent Android processes that don't chew the battery, as it deals with alarms and cpu locking.

If you want to read more stuff like this, follow my blog rss twitter or check out the rest of my articles: All, Android related, Perl related. If you found this article helpful, interesting or entertaining, and wish to donate:

CommentsAdding comments disabled for this post