Reputation: 11
Does any body here have experience with setting up splash screen for Phonegapbuild Android app?
I am struggling with seeing my splash screen. have tried different approaches I found on the web but my splash screens still don't load:
In config.xml I have the following
<preference name="auto-hide-splash-screen" value="false" />
<preference name="SplashScreen" value="splash" />
<preference name="SplashScreenDelay" value="10000" />
The default splash screen is right in the root folder where index.html
is.
My config.xml looks like this example.
Upvotes: 0
Views: 113
Reputation: 3838
This is how I coded for splash screen android app with phonegap build [v3.3.0].
Added these lines in config.xml
shared below :-
//Portrait
<gap:splash src="res/screen/android/splash/screen-ldpi-portrait.png" gap:platform="android" gap:density="ldpi" gap:qualifier="port-ldpi" />
<gap:splash src="res/screen/android/splash/screen-mdpi-portrait.png" gap:platform="android" gap:density="mdpi" gap:qualifier="port-mdpi" />
<gap:splash src="res/screen/android/splash/screen-hdpi-portrait.png" gap:platform="android" gap:density="hdpi" gap:qualifier="port-hdpi" />
<gap:splash src="res/screen/android/splash/screen-xhdpi-portrait.png" gap:platform="android" gap:density="xhdpi" gap:qualifier="port-xhdpi" />
//Landscape
<gap:splash src="res/screen/android/splash/screen-ldpi-landscape.png" gap:platform="android" gap:density="ldpi" width="320" height="200" gap:qualifier="land-ldpi"/>
<gap:splash src="res/screen/android/splash/screen-mdpi-landscape.png" gap:platform="android" gap:density="mdpi" width="480" height="320" gap:qualifier="land-mdpi"/>
<gap:splash src="res/screen/android/splash/screen-hdpi-landscape.png" gap:platform="android" gap:density="hdpi" width="800" height="480" gap:qualifier="land-hdpi"/>
<gap:splash src="res/screen/android/splash/screen-xhdpi-landscape.png" gap:platform="android" gap:density="xhdpi" width="1280" height="720" gap:qualifier="land-xhdpi"/>
Note: Please give the exact name for the images.Take care of width and height.
Also, src
must have the absolute source file path for the images. In my case, res/screen/android/splash/
is the folder containing splash image files.
Upvotes: 1
Reputation: 1465
You don't need these:
<preference name="auto-hide-splash-screen" value="false" />
<preference name="SplashScreen" value="splash" />
I have working splash screens and I don't use these.
You also don't specify whether this on Android or not. On Android your code should work.
Upvotes: 0