Search code examples
androidscreen-resolutionwallpaper

Do I have to have one wallpaper file for each screen resolution?


There is an app that sets 960x800 image as phone's wallpaper. I found that many developers suggest this resolution. However, an image is still getting cropped. I use a basic code for setting the wallpaper

WallpaperManager wallpaperManager = WallpaperManager.getInstance(getApplicationContext());
wallpaperManager.setResource(R.drawable.some_image);

I need an advice on what to do next:

  1. Make one wallpaper for each screen resolution?
  2. Programmatically resize image to a current screen resolution?
  3. I am using the wrong code and there is a better one

If the second choice is the right solution, how should I do it? I'd appreciate some links if there's too much coding involved.

Thanks


Solution

  • Use a 9-patch image for backgrounds, wallpapers are the same I think. Google docs on Android recommend this. This image is stretchable. A good link explaining it is here.