Ambient light sensor
Android reads lux with no prompt; iOS has no public ambient light API.
In one line
Can measure room light on Android, but can't on iPhone
Android reads lux with no prompt; iOS has no public ambient light API.
Shows whether the person is indoors, outdoors or in the dark.
What it can and can't do
What the user does: Nothing. On Android it happens when the app uses auto brightness or a light meter feature
It can
- Measure the light level around an Android phone, up to about 40000 lux
- Adjust screen colors or brightness to match the room (Android)
- Check the screen brightness setting on iPhone, which does not show the room
It cannot
- Measure room light on iPhone; no public sensor exists
- Learn the room from iPhone brightness, which only shows your setting
- Ask you first on Android; no prompt is used
How it differs between platforms: Android shares the light sensor with no prompt. iPhone has no public ambient light sensor.
On Android and iPhone
| Android | iPhone | |
|---|---|---|
| Status | Supported | Not supported |
| First version | Android 1.5 (API 3) | Not available |
| Permission or entitlement | Not listed | none |
| Protection level | none | not-exposed |
| How access is granted | none | not-exposed |
| What the user sees | Not listed | Not listed |
| How long it lasts | Not listed | Not listed |
| How to take it back | Not listed | Not listed |
| Store policy | None listed | None listed |
| API | Sensor.TYPE_LIGHT | No public ambient light API |
| Notes | Lux 0 to about 40000 | UIScreen.brightness is the only proxy, and it reflects the setting not the room |
Data you get
What comes back: Illuminance
Shape: float
How often: On change
| Field | Type | Unit | Range | Precision |
|---|---|---|---|---|
lux | float | lux | 0 to 40000 | depends on OEM |
Technical limits
- iOS has no equivalent
The story
What it is
An app can read how bright the light is around your phone.
For you
You never see it. Your screen brightness and some apps adapt to a dark room or bright sun. It tells apps whether you are indoors, outside or in bed.
For makers
Makers use it to switch to a dark screen or boost contrast in bright light. It also lets analytics guess your context. Researchers have also shown it can leak details about what is on a screen nearby.
Where you see it
| Type | Example | Apps |
|---|---|---|
| media | A reader app turns to a warmer, darker page when the room gets dark. | None named |
| fitness | A cycling app raises screen contrast when you ride in bright sun. | None named |
| creative | A camera app picks a night mode when it senses low light. | None named |
| games | A game dims its menu when you play in the dark so it is easier on your eyes. | None named |
| smart-home | A smart home app turns lights on when your phone sees that the room is dark. | None named |
| analytics | A tracker uses light levels to guess if you are indoors, outdoors or in bed. | None named |
Risks
- Reveals context
- Weak fingerprint bit
Android and iPhone in short
- Android: Android reads light in lux with no prompt.
- iPhone: iPhone has no public light sensor for apps, though the system adjusts brightness itself.
What the platform says
- Google: Light sensor. Android's environment sensors let apps read the light level in lux.
Good uses and abuse
Legitimate uses
- Adaptive UI
Known abuse
- Context inference
Scores
| Score | Value | Meaning |
|---|---|---|
| Sensitivity | 2 of 5 | How revealing the data is |
| Utility | 2 of 5 | How useful it is to honest apps |
| Friction | 0 of 5 | How much the user has to do |
| Fingerprint bits | 1 | Rough identifying entropy, when known |
Related capabilities
Related
- Screen brightness. Can check your screen brightness with no prompt, and change it while the app is open
Same idea on the web
- AmbientLightSensor. Can't use your device's light sensor in most browsers today
Sources
How well checked: Based on official documentation.