Search code examples
androidcordovasplash-screenphonegap-build

PhoneGap Build - Set splash-screen for Android devices


I'm currently trying to set an splash-screen for Android devices in PhoneGap build. I set 4 different screens, but somehow the screens get deformed and lost their aspect ratio. Is there a way to prevent that?


Solution

  • Do'h, missing that the question was about Android, here is the Android section from my config.xml:

    <gap:splash src="img/splash/android/ldpi.png" gap:platform="android" gap:density="ldpi" />
    <gap:splash src="img/splash/android/mdpi.png" gap:platform="android" gap:density="mdpi" />
    <gap:splash src="img/splash/android/hdpi.png" gap:platform="android" gap:density="hdpi" />
    <!--<gap:splash src="splash/android/xhdpi.png" gap:platform="android" gap:density="xhdpi" />-->
    

    Yes, Apple is much easier! On Android they go by qualifier called "densities".

    To my knowledge PhoneGap Build only supports three of the four right now. ldpi, mdpi, hdpi and NOT xdpi (that is why it is commented out above).

    All Android devices will use one of these four sizes, is my understanding. Obtaining perfect aspect ratio across hundreds of different devices may be a little challenging, but with this you at least get close .

    Read this, I know it is a lot, but worth the reading: http://developer.android.com/guide/practices/screens_support.html#support

    And, the PGB Guidelines: http://build.phonegap.com/docs/config-xml