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
  • 13,460
  • 29
  • 98
  • 167

2 Answers2

1

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

Kristian Evensen
  • 1,315
  • 13
  • 14
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,766
  • 2
  • 24
  • 39