Breaking News
Loading...
, ,

Add an Icon and Splash Screen in Phone Gap | Android Tutorial

Share on Google Plus


Usage and Additional Information

The following is a list of the currently supported icon and splash screens supported for this release of Cordova/Phonegap on PhoneGap Build.
Unless otherwise specified in a config.xml, each platform will try to use the default icon.png during compilation. To define platform specific icons please use the guide provided below.
Icon files should be the file formats specified in the examples below, other file types are not guaranteed to work across platforms.
<icon>
You can have zero or more of these elements present in your config.xml. If you do not specify a icon then the PhoneGap logo will be used as your application's icon.
src: (required) specifies the location of the image file, relative to your www directory
width: (optional) but recommended to include, width in pixels
height: (optional) but recommended to include, height in pixels

Adding Icons

Default

The default icon must be named icon.png and must reside in the root of your application folder.
<icon src="icon.png" />

Android

We support all Android resource qualifiers. Commonly used qualifiers refer to device density and language.
<icon src="ldpi.png" gap:platform="android" gap:qualifier="ldpi" />
<icon src="mdpi.png" gap:platform="android" gap:qualifier="mdpi" />
<icon src="hdpi.png" gap:platform="android" gap:qualifier="hdpi" />
<icon src="xhdpi.png" gap:platform="android" gap:qualifier="xhdpi" />
<icon src="xxhdpi.png" gap:platform="android" gap:qualifier="xxhdpi" />
<icon src="fr-xxhdpi.png" gap:platform="android" gap:qualifier="fr-xxhdpi" />
A list of these qualifiers can be viewed on Table-2 here. Note that compound qualifiers (eg. "port-xhdpi") have to
be in the same order as viewed on this table.
We also support the deprecated gap:density attribute that will only support the following densities:
<icon src="ldpi.png" gap:platform="android" gap:density="ldpi" />
<icon src="mdpi.png" gap:platform="android" gap:density="mdpi" />
<icon src="hdpi.png" gap:platform="android" gap:density="hdpi" />
<icon src="xhdpi.png" gap:platform="android" gap:density="xhdpi" />
<icon src="xxhdpi.png" gap:platform="android" gap:density="xxhdpi" />
We do not recommend using this attribute as the above gap:qualifer attribute offers more flexibility and more importantly, future support of new screen sizes etc.

Adding Splash Screens


Android

We support all Android resource qualifiers. Commonly used qualifiers refer to device orientation, language and density.
<gap:splash src="ldpi.png" gap:platform="android" gap:qualifier="ldpi" />
<gap:splash src="mdpi.png" gap:platform="android" gap:qualifier="mdpi" />
<gap:splash src="hdpi.png" gap:platform="android" gap:qualifier="hdpi" />
<gap:splash src="xhdpi.png" gap:platform="android" gap:qualifier="xhdpi" />
<gap:splash src="fr-xhdpi.png" gap:platform="android" gap:qualifier="fr-xhdpi" />
<gap:splash src="portrait-xxhdpi.png" gap:platform="android" gap:qualifier="port-xxhdpi" />
<gap:splash src="landscape-xxhdpi.png" gap:platform="android" gap:qualifier="land-xxhdpi" />
A list of these qualifiers can be viewed on Table-2 here. Note that compound qualifiers (eg. "port-xhdpi") have to
be in the same order as viewed on this table.
Patch-9 backgrounds are supported. All patch-9 files have to have a ".9.png" suffix.
We also support the deprecated gap:density attribute that will only support the following densities:
<gap:splash src="ldpi.png" gap:platform="android" gap:density="ldpi" />
<gap:splash src="mdpi.png" gap:platform="android" gap:density="mdpi" />
<gap:splash src="hdpi.png" gap:platform="android" gap:density="hdpi" />
<gap:splash src="xhdpi.png" gap:platform="android" gap:density="xhdpi" />
<gap:splash src="xxhdpi.png" gap:platform="android" gap:density="xxhdpi" />
We do not recommend using this attribute as the above gap:qualifer offers more flexibility and more importantly, future support of new screen sizes etc.

You Might Also Like

0 comments

About me


Like us on Facebook