Skip to Content
Platform.Ontology

Screen size and density

Reads pixel size, density and scale factor with no prompt.

Gets silentlyDevice detailsDisplayAndroid and iPhoneWhen the app opensWhile you use it

In one line

Can see your screen size, sharpness and scale, with no prompt

Reads pixel size, density and scale factor with no prompt.

Identifies the device model almost uniquely on iPhone and narrows it on Android. Needed for layout; also a long-lived fingerprint field.

What it can and can't do

What the user does: Nothing. The app checks when it opens, to lay out its screens

It can

  • See screen width and height, in pixels on Android and points on iPhone
  • See sharpness, 120 to 640 dpi on Android and scale 2 or 3 on iPhone
  • Fit its layout to your screen
  • See window size on newer Android

It cannot

  • Learn who you are from screen size alone
  • See what is on screen in other apps
  • Change the screen resolution

On Android and iPhone

AndroidiPhone
StatusSupportedSupported
First versionAndroid 1.0 (API 1)iOS 2.0
Permission or entitlementNot listednone
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
APIDisplayMetrics (widthPixels, heightPixels, density, densityDpi), WindowMetrics (API 30)Scale 2.0 or 3.0 on iPhone; bounds in points
NotesDensity 120 to 640 dpi; size in pxNone

Data you get

What comes back: Width, height, density
Shape: object
How often: On change (rotation, fold)

FieldTypeUnitRangePrecision
width_pxintegerpx320 to 38401 px
densityfloatratio0.75 to 4.00.25 steps

Technical limits

  • Multi-window and foldables report window, not screen, size

The story

What it is

An app can read the size of your screen and how sharp it is.

For you

You never see it. It is needed to draw the app properly. It also tells an app almost exactly which phone you have.

For makers

Makers need it to lay out screens for every size. Because the numbers are so specific, they also work as a long lasting fingerprint detail.

Where you see it

TypeExampleApps
gamesA game scales its menus and touch buttons to fit your exact screen.None named
shoppingA store app shows a grid with two or three product columns depending on your width.None named
creativeA drawing app sizes its canvas to the screen sharpness.None named
mediaA video app picks a video size that fits your screen and saves data.None named
adsAn ad network picks an ad size and joins it with other details to guess your phone.None named
accessibilityA reading app lets you pick larger text based on your screen density.None named

Risks

  • Narrows down your phone model
  • Long lived fingerprint detail

Android and iPhone in short

  • Android: Reads pixel size, density and scale factor with no prompt.
  • iPhone: Reads size and scale, which pins down the iPhone model.

Good uses and abuse

Legitimate uses

  • Layout

Known abuse

  • Fingerprint

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 bits5Rough identifying entropy, when known

History

  • 2020-09, Android 11 (API 30): WindowMetrics added for multi-window
  • 2020-09, iPhone iOS 13: Per-scene screens (UIWindowScene) replace main-screen use

Same idea on the web

Sources

How well checked: Inferred from related behavior.

On this page