0

I've done some research online with this problem, and i'm totally confused. If someone could help explain this in simple terms that would be great.

I have a background, menubackground.png. It was made in photoshop, I can resize this to any size for the different screens. It seems I get the error "the image menubackground.png varies significantly in its dpi across various density versions"

I have this in the xml file :

android:background="@drawable/menubackground"

I'm really confused why I get the lint error showing, I'm guessing it's because these sizes need changing according to screen size, but I have no idea what they should be to get this error removed. It's just a background, should be full screen.

Any ideas what sizes ( in pixels ) these need to be? Or, if there is something I need to change in photoshop when saving these images?

Thanks,

( Error below for details ): The image menubackground.png varies significantly in its density-independent (dip) size across the various density versions: drawable-ldpi\menubackground.png: 2017x3141 dp (1513x2356 px), drawable-mdpi\menubackground.png: 1513x2356 dp (1513x2356 px), drawable-hdpi\menubackground.png: 1009x1571 dp (1513x2356 px)

Issue: Ensures that icons across densities provide roughly the same density-independent size

Checks the all icons which are provided in multiple densities, all compute to roughly the same density-independent pixel (dip) size. This catches errors where images are either placed in the wrong folder, or icons are changed to new sizes but some folders are forgotten.

Additional Edit:

I have this for a few images, also for splash.png, but I have no idea how to calculate the sizes these should be. The background is a full screen background. The splash is just an image for the splash screen, centered.

ThePerson
  • 3,048
  • 8
  • 43
  • 69

1 Answers1

0

You have supplied the same image into 3 different folders it seems.

Unless you want to specify different versions for different densities, just have the hdpi version, leave the other folders empty and let android resize it.

weston
  • 54,145
  • 21
  • 145
  • 203
  • Thanks. I think if it's better practise, I can make the other versions really easily, especially if it will save memory / loading times. It's one of my first projects, so I'd like to make it as good as possible. That would get rid of the problem perhaps, but I'm wondering what sizes the others should be if I was to want to have them? I really appreciate your help! Thankyou! It's correct currently that I have the same image in three folders, it also shows an error saying menubackground.png icon has identical contents in the following configuration folders: hdpi, ldpi, mdpi. – ThePerson Feb 09 '12 at 14:35
  • http://stackoverflow.com/questions/6166677/android-screen-size-hdpi-ldpi-mdpi This is useful, but I don't know if I am understanding it correctly. Do I need these three sizes for a full screen background? 240x320 ldpi, 320x480 mdpi, 480x800 hdpi Thanks – ThePerson Feb 09 '12 at 14:43
  • Found it here: http://stackoverflow.com/questions/5476538/what-size-should-xhdpi-launch-icons-be Thanks for the answer weston, you guided me to the correct places. Marking as answer – ThePerson Feb 09 '12 at 14:54
  • If you want to improve loading times/memory, start smaller, your images are massive. My splash screens are just 800x480 and I put in the hdpi folder only. No point worrying about those with higher res screens IMO, it will scale adequately. But do consider what happens when the screen is different aspect ratio. Good luck. – weston Feb 09 '12 at 15:11