cordova - I can't make SplashScreen work on an Android phonegap project -
i installed plugin using cli thru this: $ cordova plugin add together https://git-wip-us.apache.org/repos/asf/cordova-plugin-splashscreen.git
my cordova version is: 3.4.0-0.19.17
cordova.js version of project is: 3.4.0
i followed instruction in documentation can't seem create work. here res directory:
here config.xml files regarding splashscreen:
config.xml
<feature name="splashscreen"> <param name="android-package" value="org.apache.cordova.splashscreen.splashscreen" /> </feature>
config.xml
<plugin name="splashscreen" value="org.apache.cordova.splashscreen"/> <platform name="android"> <splash src="www/res/drawable/splashscreen.png" /> </platform> <preference name="splashscreen" value="screen" /> <preference name="splashscreendelay" value="10000" />
my device ready function on index.html:
document.addeventlistener("deviceready", ondeviceready, false); function ondeviceready() { navigator.splashscreen.show(); redirectto("./main.html"); }
what perchance wrong?
follow instructions on phonegap documentation page: http://docs.phonegap/en/3.4.0/config_ref_images.md.html#icons%20and%20splash%20screens size each should be: xlarge (xhdpi): @ to the lowest degree 960 × 720 big (hdpi): @ to the lowest degree 640 × 480 medium (mdpi): @ to the lowest degree 470 × 320 little (ldpi): @ to the lowest degree 426 × 320 create sure have these in config.xml: <preference name="splashscreen" value="screen" /> <preference name="splashscreendelay" value="10000" /> set copies of splash screen image (each having right resolution target platform) in drawable* folders, this: platforms/android/res/drawable/screen.png platforms/android/res/drawable-hdpi/screen.png platforms/android/res/drawable-ldpi/screen.png platforms/android/res/drawable-mdpi/screen.png platforms/android/res/drawable-xhdpi/screen.png also, suggest removing config file: <preference name="auto-hide-splash-screen" value="true" />
android cordova splash-screen
No comments:
Post a Comment