When we launch our android application to playstore, the major part which helps us with the branding of the app is splash screen image. In the following table, we have listed the various sizes of the splash screen image ( in jpg ) used for different screen sizes.
LDPI | |
Portrait | 200 x 320 px |
Landscape | 320 x 200 px |
MDPI | |
Portrait | 320 x 480 px |
Landscape | 480 x 320 px |
HDPI | |
Portrait | 480 x 720 px |
Landscape | 720 x 480 px |
XHDPI | |
Portrait | 640 x 960 px |
Landscape | 960 x 640 px |
XXHDPI | |
Portrait | 960 x 1440 px |
XXXHDPI | |
Portrait | 1280 x 1920 px |
Landscape |
These images needs to be copied as,
app/src/main/res/drawable-hdpi/img_splash.jpg
app/src/main/res/drawable-mdpi/img_splash.jpg
app/src/main/res/drawable-xhdpi/img_splash.jpg
app/src/main/res/drawable-xxhdpi/img_splash.jpg
app/src/main/res/drawable-xxxhdpi/img_splash.jpg
and in the manifest, you need to define this splash image as, “android:background=”@drawable/img_splash””
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:background="@drawable/img_splash"
tools:context=".SplashScreenActivity">
</RelativeLayout>