In series post of PhoneGap ,I have explained basic about PhoneGap and Internet connection issue in Android so Today I am going to explain about to set Icons and Splash Screens in PhoneGap App in Android.
The splash screen is an image which appears while a program is loading so it’s very important and the first screen when working with an android application.
First of all,Go to res folder of your project and add created splash image into desired drawable folder.
res folder will have the following kind of folders:
Now, Go to src/
1 2 3 4 | Super.setIntegerProperty("splashscreen",R.drawable.<splash_image_name_without_extension>"); |
Next,Check your res/xml/config.xml file in that splashscreen plugin is enable:
1 2 3 |
To hide splash screen into the main page.
1 2 3 4 5 6 7 | document.addEventListener("deviceready", onDeviceReady, false); function onDeviceReady() { navigator.splashscreen.hide(); } |
That’s it. This is all about splash screen now let’s see how to set icon in an android application with PhoneGap.
You need to place your icon image into same drawable Resource Folder in .png format and then set it in the AndroidManifest.xml file’s Application Tab.
1 2 3 | Icon: @drawable/<icon_name_without_extension> |
Also Read:
To use JSON Response of Webservice in Phonegap Android
Save Image/File into sd card in Android using PhoneGap
To setup SQLite for Android-Phonegap application
Don’t hesitate to use this code in your Android application and post your comments if you need help. As always, thanks for reading. Don’t Forget to Follow us on Twitter or Subscribe us to Get the Latest Updates.