Icons and Splash Screens

Icons and Splash Screens Across Platforms

Without an icon, BookNest ships Cordova 129 's logo. <icon src="res/icon.png" /> sets one image for every platform, but Android 8 and later draw adaptive icons: a 108 dp foreground layer, important part in the central 66 dp, over a background that the launcher masks to its shape. BookNest's foreground is a white "B", drawn once per density, over a green color that a <resource-file> copies into the Android resources:

The icon and splash settings in BookNest's config.xml (Android block)XML
<resource-file src="res/android/colors.xml"
               target="/app/src/main/res/values/colors.xml" />
<icon density="mdpi" foreground="res/android/fg-mdpi.png"
      background="@color/icon_bg" />
<!-- ... the same for ldpi, hdpi, xhdpi, xxhdpi and xxxhdpi (81 to 432 pixels square) -->
<preference name="AndroidWindowSplashScreenAnimatedIcon"
            value="res/android/fg-xxxhdpi.png" />

colors.xml defines <color name="icon_bg">#2E7D32</color>. Supply every density: a density you skip keeps Cordova's icon. The build copies each foreground to mipmap-<density>-v26/ic_launcher_foreground.png next to an adaptive ic_launcher.xml, and the splash icon to drawable-nodpi. Since Android 12 the system draws the splash screen itself from an icon and a background color, and cordova-android maps the two AndroidWindowSplashScreen preferences onto it:

BookNest's splash screen and its adaptive icon in the Android 16 app drawer
BookNest's splash screen and its adaptive icon in the Android 16 app drawer

The plain mipmap-<density> folders get the foreground alone, a fallback for Android 7. A monochrome layer adds Android 13's themed icons. iOS takes square PNGs, one <icon> per size (The iOS Platform).