Check out this tutorial. I have a modified version pulling in battery level and charging state. Also does location.