Search code examples
androidandroid-resolution

How to design image for splash screen?


I would like to show a splash screen image. I've read Screen compatibility overview about the different directories (ldpi, mdpi, ...) to create under res/ but I've not understood if, other than creating the same image of 240x320, 320x480 and 480x800 I need to do other things to achieve a good result.
Can anyone suggest me which is the best thing to do?


Solution

  • What you describe is what you need to do. You need an image for each screen pixel density group (ldpi, mdpi, hpdi and poss xhdpi)

    Other things you can do?

    • Use a background around the image so the image appears to stretch (e.g. if image is white near the edges, use a white background). It'll look better if there isn't an obvious border around the image and it fades into a background.
    • The background/borders could be a 9-patch, stretchable image
    • In theory you could provide a lot more images and select them at runtime based on actual screen size, but it's a very bad idea (you never know what new sizes are coming)
    • Remember to include portrait and landscape versions - never a good idea to assume one orientation if you can possibly avoid it

    Think of an Android screen like a resizable web page - they come in various different sizes and shapes, and your layout needs to stretch and adapt for all.