Creating Splash screen / Start up screen for Android app using phonegap / jqtouch
I’ve recently started working on developing andorid a app using phonegap. I have got my application on andoid phone and I notice that there was black blank screen shows up before showing the main application page. So i have decided to put a splash screen on the app and played in jqtouh but that did not help me.
After lots of searching on the internet I have learned that the changes need to be done the main activity class that inherits from DroidGap and also splash screen support on Android was added in version 0.9.3.
Now here is the simple solution:
1) Create a slash screen with splash.png filename
2) Add splash.png file to drawable-hdpi folder which is under the res folder.
3) the thread super.setIntegerProperty( “splashscreen”, R.drawable.splash ); needed to be added to DefaultActivity.java file in the onCreate method. you should place this thread before “loadURL”. For example:
Here is the method in in the relevant file (src>com.testapp>myapp.java) /** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); super.setIntegerProperty("splashscreen", R.drawable.splash); super.loadUrl("file:///android_asset/www/index.html"); }
3) Now run the application.
Hope it works for you also….
It works for me….
Thanks
hey,
i have been trying to make this work but when ever i use the code u have shown , it just crashes saying that resource not found but when i give a second argument in
this
like
super.loadUrl(“file:///android_asset/www/index.html”,2000);
it shows the splash screen for 2 second but again crashes
HI,
Its not work for me.. i have downloaded phonegap 1.2.0, which is obviously later version of 0.9.0, but still when i try to include super.loadUrl(“file:///android_asset/www/index.html” line, it doesn’t appear anything.. can you please help me..
Thanks in advance
Doesn’t works for me.
can u provide what error you are getting?
hi,
replace ur code like this,
super.loadUrl(“file:///android_asset/www/index.html”,2000);
its work for me…:-)
Do we have any option of skipping that black screen before the main application? Thanks.
please follow this:
1)place a splash screen image into u r project.
2)goto image properties for that select image rightclick on mouse then it
will display properties
3)in that Set Built Auction as Content.
4)then rename the picture as SplashScreenImage.jpg
before u can remove the default splash screen image.
then it will work fine!!!!!!!!!.