1

I was wondering if there is a way to measure power(a battery level) of android device.. I can see applications doing something with a battery level of an Android device so I was wondering how I can get the battery level from Android APIs. Thanks in advance..

codereviewanskquestions
  • 12,620
  • 25
  • 97
  • 162

2 Answers2

1

Yes, there is. Check out the BatteryManager class of the SDK.

Kristian Evensen
  • 1,257
  • 11
  • 13
0

There's a broadcast receiver that tell you when the battery level changes. See this thread for code: Android Battery in SDK

Community
  • 1
  • 1
aleph_null
  • 5,746
  • 2
  • 23
  • 37