Skip to Content
Platform.Ontology

Battery level and charging state

Reads battery percent and whether the phone is plugged in, with no prompt.

Gets silentlyDevice detailsPowerAndroid and iPhoneWhen the app opensWhile you use it

In one line

Can see your battery percent and if the phone is charging, with no prompt

Reads battery percent and whether the phone is plugged in, with no prompt.

Shows routine (charging overnight at home) and pairs with other signals to track a device. Apps use it for power-aware sync; Olejnik et al. showed level and discharge time can tag a device briefly.

What it can and can't do

What the user does: Nothing. The app checks while it is open

It can

  • See your battery level from 0 to 100
  • See if the phone is plugged in and whether it is on a charger, USB or wireless (Android)
  • Watch the level change while the app is open
  • Use it to change app behavior, such as pausing downloads

It cannot

  • See battery health or cycle count
  • Get a real level in the iPhone simulator, which returns minus one
  • See your level on iPhone unless it turns monitoring on first
  • Show your exact reading to others by itself

How it differs between platforms: Android shares the level through a system broadcast. iPhone apps must turn on battery monitoring first.

On Android and iPhone

AndroidiPhone
StatusSupportedSupported
First versionAndroid 1.0 (API 1)iOS 3.0
Permission or entitlementNot listedNot listed
Protection levelnonenone
How access is grantednonenone
What the user seesNot listedNot listed
How long it lastsNot listedNot listed
How to take it backNot listedNot listed
Store policyNone listedNone listed
APIACTION_BATTERY_CHANGED sticky broadcast; BatteryManager.getIntProperty(BATTERY_PROPERTY_CAPACITY) (API 21)UIDevice.batteryLevel, batteryState; set isBatteryMonitoringEnabled = true
NotesLevel is integer 0 to 100; plugged type AC, USB, wirelessReturns -1.0 in the simulator or when monitoring is off

Data you get

What comes back: Battery level and plug state
Shape: float
How often: On change (broadcast or notification)

FieldTypeUnitRangePrecision
levelintegerpercent0 to 1001 percent steps
ios_battery_levelfloatfraction-1.0, 0.0 to 1.01 percent steps (pre iOS 8: 5 percent)
stateenumNoneunplugged, charging, full, unknown4 values

Technical limits

  • No prompt on either platform
  • Fingerprint use is time limited because the level changes

The story

What it is

An app can see your battery percent and whether you are charging.

For you

You never get asked. The app might delay a big download until you plug in. It might also learn that you charge overnight at home.

For makers

Makers use it for smart syncing and to avoid draining your phone. Combined with other signals, battery level and charge state can tag a device for a short time.

Where you see it

TypeExampleApps
gamesA game lowers frame rate and effects when your battery is below 20 percent.None named
mediaA video app offers to download shows only while you are plugged in.None named
fitnessA running app warns you that your battery may not last the whole workout.None named
mapsA navigation app suggests plugging in because your battery is low on a long trip.None named
adsAn ad firm adds battery level to a short term device signature.None named
rideshareA ride app tells a driver to charge before accepting a long trip.None named

Risks

  • Shows your routine
  • Can help tag a device

Android and iPhone in short

  • Android: Read through a standard broadcast with no permission.
  • iPhone: Read through UIDevice battery monitoring, with no prompt.

Good uses and abuse

Legitimate uses

  • Defer sync on low battery
  • Show charge reminders

Known abuse

  • Short-lived device tag
  • Infer home location from charging times

Scores

ScoreValueMeaning
Sensitivity1 of 5How revealing the data is
Utility3 of 5How useful it is to honest apps
Friction0 of 5How much the user has to do
Fingerprint bits2Rough identifying entropy, when known

History

  • 2014-09, iPhone iOS 8: Battery level moved from 5 percent to 1 percent steps
  • 2015-10, Android 5.0 (API 21): BATTERY_PROPERTY_CAPACITY property added

Same idea on the web

  • Battery Status. Can see your battery level and charging state, with no prompt in Chrome

Sources

How well checked: Checked against real behavior.

On this page