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?
Asked
Active
Viewed 8,070 times
7

Christopher Moore
- 15,626
- 10
- 42
- 52

Cris
- 12,124
- 27
- 92
- 159
2 Answers
8
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.

Ollie C
- 28,313
- 34
- 134
- 217
0
Like Ollie C said, I also make a 9-patch that I set in background, the only probleme with this methos is that your Splashscreen must have uniform stretchable areas.

Climbatize
- 1,103
- 19
- 34