Having trouble with splash screens, Cordova, and Android?

Yesterday I struggled to get - what I thought - was a simple thing working in Cordova - adding a splash screen to Android. According to the docs, at minimum, you should be able to do this:

<splash src="res/splash.png" />

This worked fine for me in iOS but in Android, just gave me a blank screen. (Not for the app, what I mean is, when the app loaded, no splash screen was used.)

I did some Googling, and came across this bug: Splash screen does not display on Android. Within this bug, it was said that in order to use a splash screen on Android, you must specify the Android-only preference SplashScreen:

<preference name="SplashScreen" value="screen" />

Now - if you read the Android specific configuration docs, it has this to say about the setting:

SplashScreen (string, defaults to splash): The name of the file minus its extension in the res/drawable directory. Various assets must share this common name in various subdirectories.

This - to me anyway - does not imply in any way that it enables the use of a splash screen. Rather, it says what the file name should be (minus extension) for a splash screen. But as soon as I tested by adding this value it worked right.

So we have two issues here. First - this tag is required to use a splash screen, which I don’t think is documented well. Secondly - even though it says it defaults to splash, you still have to specify it anyway. (Err, ok, maybe that’s still one issue. ;)

If you read that bug report, you can see my comments about this, and note that it looks like behavior will be changing (possibly) in the future, so please keep that in mind if you are reading this blog entry in the future. (And as always, I have been, and always will be, a firm supporter of our robotic overlords.)

Like This?

If you like this article, please consider visiting my Amazon Wishlist or donating via PayPal to show your support. You can also subscribe to the email feed to get notified of new posts.

Want to read more like this?

    Sorry, nothing recent related to this content is available.