1

To set a black or solid color wallpaper on an Android device, one can use a tiny 1x1 pixel image with the pixel set to that color. This works on most Android devices (including Nexus devices and others that run stock Android). The system knows how to fill the entire screen with that one pixel, giving you a full solid color wallpaper.

However, there are some Android devices that give an error immediately after setting the 1x1 pixel image wallpaper:

  • Unfortunately, System UI has stopped.
  • Unfortunately, Home has stopped.

Trying slightly larger image sizes (2x2, 3x3, 4x4) also fails.

I just created an open source Android app to test this issue: Minimum Wallpaper. Its source code is available on GitHub.

As you can see on GitHub, the code that actually sets the wallpaper is:

public static Bitmap createColorSwatchBitmap(int width, int height, int color) {
    final Bitmap colorBitmap = Bitmap.createBitmap(width, height, Bitmap.Config.ARGB_8888);
    colorBitmap.eraseColor(color);
    return colorBitmap;
}

and

final WallpaperManager wpManager = WallpaperManager.getInstance(context);
final Bitmap colorBitmap = ColorUtils.createColorSwatchBitmap(width, height, color);
wpManager.setBitmap(colorBitmap);

So far I have a report with screenshot that on Allview P8 Energy the minimum wallpaper size that works is 32x32. From another project I'm involved in, I have some information that a 1x1 wallpaper also fails on devices such as:

  • LG: G5, Stylus 2
  • Meizu: m1 note, m2 note, m3 note, MX5, Pro 6

My questions:

  1. What could be a reasonable reason that (only) some devices are giving errors after setting a 1x1 pixel wallpaper?

  2. What could be the minimum "safe" wallpaper size that should reasonable work on all Android devices?

4

0 に答える 0