Audit: icon size coverage
See original GitHub issueHomescreen icon requirement
in //src/chrome/android/java/res/values/dimens.xml
and app_banner_data_fetcher.cc
<dimen name="webapp_home_screen_icon_size">48dp</dimen>
Splash screen requirement
TLDR: There are 2 layouts for splash screens. You get the “small icon layout” if the icon you provide is <= 80dp. You get the “large icon layout” if it’s over >80 dp. Ideal size for splash screen is 128dp. (There is also a way that a non-provided icon is used, though it’s unclear what that is.)
// from chromium /src/chrome/android/java/res/values/dimens.xml
<dimen name="webapp_splash_image_size_ideal">128dp</dimen>
<dimen name="webapp_splash_image_size_threshold">80dp</dimen>
<dimen name="webapp_splash_image_size_minimum">48dp</dimen>
There are three possible layouts for splash screens, which is chosen based on whether an icon was auto-generated by Chrome and whether the icon is bigger than a threshold.
see how the splash layout and icon is chosen in //src/chrome/android/java/src/org/chromium/chrome/browser/webapps/WebappActivity.java
So far, our magic numbers are 48dp
and 128dp
…
dp and px
For phone-sized android devices, we mostly care about hdpi
and up. (The Android One is hdpi
) You can ignore anything less than hdpi
For example, the nexus 5 and nexus 6p are xxhdpi
and xxxdpi
respectively. (four-x doesn’t exist yet, phew!)
So what do we need?
I dumped our key dp numbers into http://androidpixels.net/ (and hacked the page with devtools) for this 💰💰💰 screenshot:
So… tl;dr:
If you’d like to provide native rendering of icon for home-screen and splash-screen across supported screen densities, you should provide an icon in these sizes:
72, 96, 144, 192, 256, 384, 512
And all of these should be explicitly indicated in your manifest.
Update: conversation below indicates you need fewer than this:
192, 512
Dec 2020 edit: some related stuff in https://github.com/GoogleChrome/lighthouse/issues/11762
Issue Analytics
- State:
- Created 7 years ago
- Comments:19 (8 by maintainers)
@paulirish Is there a separate issue for this which we can subscribe to? I’d love to stay up to date on the topic (512px splash screen not showing when 192px icon is provided). It seems to be an Android or Chrome for Android related problem.
Thanks Hendrik and Pedro. We’ll look into it.