codereviewanskquestions
codereviewanskquestions

Reputation: 14008

Measure a battery level of Android devices

I was wondering if there is a way to measure power (battery level) of an 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.

Upvotes: 1

Views: 1358

Answers (2)

aleph_null
aleph_null

Reputation: 5786

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

Upvotes: 0

Kristian Evensen
Kristian Evensen

Reputation: 1345

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

Upvotes: 1

Related Questions