Splash screen problem solved! - Forum

Forum Navigation
You need to log in to create posts and topics.

Splash screen problem solved!

we can create a splash screen for our application in four  steps:

step1-we first need make our own splash screen design with the below size:

  • ldpi:
    • portrait: 200x320 px
    • Landscape:320x200 px
  • mdpi
    • portrait: 320x480 px
    • Landscape:480x320 px
  • hdpi
    • portrait: 480x800 px
    • Landscape:800x480 px
  • xhdpi
    • portrait: 720x1280 px
    • Landscape:1280x120 px
  • xxhdpi
    • portrait: 960x1600 px
    • Landscape:1600x960 px
  • xxxhdpi
    • portrait: 1280x1920 px
    • Landscape:1920x1280 px

step2: after making the 12 images according above screen size, we need naming them as we wish: I like naming like this:

1P-ldpi.png                    1L-ldpi.png

2P-mdpi.png                    2L-mdpi.png

3P-hdpi.png                    3L-hdpi.png

4P-xhdpi.png                    4L-xhdpi.png

5P-xxhdpi.png                    5L-xxhdpi.png

6P-xxxhdpi.png                    6L-xxxhdpi.png

step3: we add this images to (project>properties >library and file> add file)

step4: after compiling the application we should add these codes in .xml file of our project:

<splash platform="android" qualifier="port-ldpi" src="img/1P-ldpi.png" />
<splash platform="android" qualifier="port-mdpi" src="img/2P-mdpi.png" />
<splash platform="android" qualifier="port-hdpi" src="img/3P-hdpi.png" />
<splash platform="android" qualifier="port-xhdpi" src="img/4P-xhdpi.png" />
<splash platform="android" qualifier="port-xxhdpi" src="img/5P-xxhdpi.png" />
<splash platform="android" qualifier="port-xxxhdpi" src="img/6P-xxxhdpi.png" />

<splash platform="android" qualifier="land-ldpi" src="img/1L-ldpi.png" />
<splash platform="android" qualifier="land-mdpi" src="img/2L-mdpi.png" />
<splash platform="android" qualifier="land-hdpi" src="img/3L-hdpi.png" />
<splash platform="android" qualifier="land-xhdpi" src="img/4L-xhdpi.png" />
<splash platform="android" qualifier="land-xxhdpi" src="img/5L-xxhdpi.png" />
<splash platform="android" qualifier="land-xxxhdpi" src="img/6L-xxxhdpi.png" />

<gap:plugin name="cordova-plugin-splashscreen" source="npm" />

<preference name="SplashScreenDelay" value="5000"/>

note: <preference name=“SplashScreenDelay” value=“5000”/> this is show the time of displaying splash screen, we can change the value  of this, as we want.

 

 

 

 

 

luishp, Vadim and 2 other users have reacted to this post.
luishpVadimdanitofmorales

Great @asmat!
Thank you for sharing!

Thank you Asmat. It works perfect. I just suggest you to correct de colons in line 17 (it should be " and not “ ). It took me some time to realize that bug.

asmat has reacted to this post.
asmat

Hello @Asmat. This was working for me while PhoneGap was working. Now I'm using VoltBuilder and it is not recognizing this. It skips my splash screens. Do you know if there is a solution for this?