Skip to end of metadata
Go to start of metadata

You are viewing an old version of this content. View the current version.

Compare with Current View Version History

« Previous Version 2 Next »

When building your app, to offer a quality app experience you will need to consider app icons, the display name of your app, and version numbers.

These are all handled in the config.xml file that you'll find in your project root.


App Icons

To add a custom icon to your project, you'll need to add the icon tags into your config.xml file. Your icon files need to be in a folder in your project root. It doesn't matter what the folder is named, as you'll be setting the path in your config.xml, however "res" is a commonly used folder name for icons.

You can either use a single icon for all platforms and resolutions, or you can use specific icon sizes for a better result.

Single Icon:

You can set a single icon that will be used for all platforms, and all display resolutions simply by using the "icon" tag:

<icon src="res/icon.png" />


Simply copy and paste this line into your XML document. It doesn't matter where, as long as it is in the "widget" level. Keep in mind, however, that this won't offer the optimum resolutions for devices, and so on some devices the icon may look fuzzy.


Specific Icon Sizes:

To better control the look of your icons, and to ensure they don't need to be resized depending on platform and device resolution, you can set multiple icon sizes.

To do this, add the following code into theĀ <platform name="android"> section:


    <platform name="android">
        <icon src="res/android/ldpi.png" density="ldpi" />
        <icon src="res/android/mdpi.png" density="mdpi" />
        <icon src="res/android/hdpi.png" density="hdpi" />
        <icon src="res/android/xhdpi.png" density="xhdpi" />
        <icon src="res/android/xxhdpi.png" density="xxhdpi" />
        <icon src="res/android/xxxhdpi.png" density="xxxhdpi" />
    </platform>


The sizes of each icon are:

ldpi : 36x36 px
mdpi : 48x48 px
hdpi : 72x72 px
xhdpi : 96x96 px
xxhdpi : 144x144 px
xxxhdpi : 192x192 px


The example above assumes you have created multiple icon sizes, as shown, and copied them into a folder named "res/android/".

Note: The platform is mentioned here in the path, as if you need to create icons specific to other operating systems, you could put the icons in their own folder (such as res/ios/ or res/windows/).




  • No labels