Search code examples
androidimageviewsplash-screen

Android universal splash screen for multiple devices


I need to support multiple screens with the app. The app is a web app and the only native part is splash screen. I have a bundle of images with the following sizes: xlarge (xhdpi): 640x960 large (hdpi): 480x800 medium (mdpi): 320x480 small (ldpi): 240x320

In case of wvga854 I have blank spaces on the top/bottom of the screen. I've solved it by creating drawable-normal-long-hdpi. If I want my app to support most of the screens and tablets (official reference then I need to create folders for all possible combinations, am I right? In that case what would be the names of those folders?


Solution

  • You've already mentioned the correct article for this problem. There is written:

    res/drawable-mdpi/my_icon.png        // bitmap for medium density
    res/drawable-hdpi/my_icon.png        // bitmap for high density
    res/drawable-xhdpi/my_icon.png       // bitmap for extra high density
    res/drawable-xxhdpi/my_icon.png     
    

    Additional you could add normal-long like you said (but I don't think this is necessary):

    res/drawable-normal-long-mdpi/my_icon.png        // bitmap for medium density
    res/drawable-normal-long-hdpi/my_icon.png        // bitmap for high density
    res/drawable-normal-long-xhdpi/my_icon.png       // bitmap for extra high density
    res/drawable-normal-long-xxhdpi/my_icon.png     
    

    Also you need to consider if you maybe create folders for different orientations (land, port)

    Edit: You should stick with Xoxols answer: android:scaleType should do the trick to get rid of gaps on top and bottom of the screen.