Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android wallpaper/background dimensions

Which are the default dimension of the Home wallpaper/background for the various Android screen configurations (small, normal and large screens with low, medium and high density)?

Are 9-patch PNG files supported for the wallpaper? Should I be using these instead?

I found a method in API level 5 that gives you the minimum size of the wallpaper, but I would like to support previous versions of Android as well.

Thanks!

like image 843
hpique Avatar asked Jan 06 '10 01:01

hpique


2 Answers

A wallpaper is twice as wide as the device held in portrait mode. So 960x800 on a Nexus One, 960x854 on a Droid, 640x480 on a G1/Magic/Hero, etc.

like image 89
Romain Guy Avatar answered Nov 03 '22 18:11

Romain Guy


This article on the Android Developers' site shows the range of screen resolutions for each density.

I believe the wallpapers have to match the screen resolution and are not stretched. You can see this if, for example, you create a new emulator with a high screen density like 480x854. The default home screen background is centred, with large black bands at the top and bottom.

The WallpaperManager API indicates that you must use a PNG- or JPEG-format image, even if you use the setResource() method — the resource must be a Bitmap and so not a nine-patch or other type of Drawable.

like image 21
Christopher Orr Avatar answered Nov 03 '22 20:11

Christopher Orr