0

PhoneGap Android Splashscreen

Posted by Nantharupan on 8:04 PM in , ,
When we developing android application using Phone Gap we might come across a situation where we need to show a splash screen when application starts. 

We can't have any splash screen in our html pages.

We need to do that in our Eclipse Android project,

Steps to Show a splash Screen

1.  Add a config file in app/res/xml/ folder and name it as config.xml

2. Add the following line in the config file

<plugin name="SplashScreen" value="org.apache.cordova.SplashScreen"/>

3. Copy your splash screen into your res/drawable  folder

4.  Add following line of code into your MainActivity which extends DroidGap.

 super.setIntegerProperty("splashscreen", R.drawable.splash);
    super.loadUrl("file:///android_asset/www/Phone/index.html,5000);

The first line 'super.setIntegerProperty sets the image to be display as splashsceen, The second line is normal load method, but second parameter to set the timeout value for the splash screen


  
Reference 


Popular posts

Copyright © 2009 On the way All rights reserved. Theme by Laptop Geek. | Bloggerized by FalconHive.