Cordova for Android Build Options

Looking for information regarding Android permissions? Scroll to the bottom of this page.

The Intel® XDK "Cordova for Android" and "Crosswalk for Android" build systems use a special configuration file in your project source directory to direct the build process. The Cordova build option is based on the open source Apache* Cordova CLI build system. When you use the Cordova build option your application project files are submitted to the Intel XDK build server where a Cordova CLI system is hosted and maintained, there is no need to install the open source Cordova CLI system on your workstation.

NOTE: As of Intel XDK version 1199, the build configuration files are automatically generated based on input you provide on the Projects tab. A special and intelxdk.config.crosswalk.xml file is automatically generated. The options described below can be use inside an intelxdk.config.additions.xml file to exercise finer grained control over the Projects tab and to control features that are not handled by the Projects tab.

The following options described on this doc page pertain only to Android and Crosswalk builds. They will not affect builds for other target platforms.You can include these options in your intelxdk.config.additions.xml file when submitting a build, in order to either supplement or replace those options that are automatically generated by the Intel XDK.

For detailed information regarding the structure and contents of the intelxdk.config.xml file please read Using Intel XDK Cordova Build Files article.

Android Launch Icon Specifications

If no icon files are provided with your project, the build system will provide default icons. It is highly recommended that you replace the default icons with icons of your own before submitting your application to a store. See this article on the Android Developer site for details regarding Android launch icons. If you do not provide custom icons it is likely that your application will be rejected from the Android store.

Icon files must be provided in PNG format. The height and width numbers in the table (below) are in pixels.

Density Width Height
xxxhdpi ‡ 192 192
xxhdpi † 144 144
xhdpi 96 96
hdpi 72 72
mdpi 48 48
ldpi * 36 36

* ldpi icon files are optional; if not provided the Android OS will automatically downscale your hdpi icon by a factor of two.

† xxhdpi icon files are only supported on hi-res Android 4.4 and above devices; these icon resolutions are not supported by Cordova 3.3.

‡ xxxhdpi icon files are not supported by any Android devices, at this time; these icon resolutions are not supported by Cordova 3.3.

The launch icon you include with your application, when you submit it to the Google Play Store, must be 512x512 pixels in size. This icon is not included in your application, it is part of your store submission package. The Intel XDK does not include a store submission tool, you must submit your application manually using your Android developer account.

Android Splash Screen Image Specifications

Your application will display a splash screen during initialization. This is done to provide a "getting ready" indication while your app and the underlying device API infrastructure initializes. The build system provides default images if no splash files are provided with your project. It is highly recommended that you replace the default splash screen images with your own before submitting your application to a store. See the splash screen section of the Cordova for * Build File Options topic for more information.

Splash screen images can be provided in PNG, JPG or JPEG formats. The height and width numbers in the table (below) are the minimum recommended pixel sizes for the respective screen densities. See this article on the Android Developer site for details regarding Android screen sizes. NOTE: the dimensions shown below assume a landscape orientation, reverse the numbers for portrait.

Density Width Height
xhdpi 960 720
hdpi 640 480
mdpi 470 320
ldpi 426 320

For greater adaptability of your splash screens, you should use 9-patch images. For more information see this StackOverflow posting and Android developer tools article.

NOTE: there have been issues with splash screens on the Cordova for Android platform when building with the Intel XDK. We have resolved the issue regarding landscape and portrait splash screens (they now work as expected). However, we are still working on making nine-patch splash screens work. When nine-patch splash screens work this notice will be removed. Until then for best results, design your splash screens to a 16:9 screen ratio and that should minimize the distortion on most modern Android phones and tablets (for example, the Samsung S3 has a 16:9 screen ratio and the Nexus 7 tablets have a 16:10 ratio). The splash screen resolutions specified above are minimum recommend dimensions, not absolute required dimensions.

Android Build Preferences

Specifies the minimum required Android operating system version on which the application will install and run. For best results it is recommended that you specify Android 2.3.3 or higher (Android 2.3.3 = 10), this value is the default if no minimum is provided. See "Versioning Your Applications" for an overview regarding how to assign version numbers to Android applications.
<preference name="android-minSdkVersion" value="<N>" />
<N> is a number representing the minimum supported Android version.
Specifies the target Android operating system. This is the version of Android you have tested against and will be used by the operating system to insure that future versions of your application continue to run by observing compatibility behaviors. See "Versioning Your Applications" for an overview regarding how to assign version numbers to Android applications.
<preference name="android-targetSdkVersion" value="<N>" />
<N> is a number representing the target Android version.

The value 19 is recommended to minimize the effect of Android 4.4 "webview quirks mode" when running your application on Android 4.4+ devices. However, some applications may need this "webview quirks mode" behavior and should then specify a lower API level (such as 17 or 18) Start with 19 and insure your app works on Android 4.4+ devices; if you see issues on Android 4.4+ devices, try using 17 or 18 and see if your app works better there.
Specifies where the application can be installed (internal memory, external memory, sdcard, etc.).
<preference name="android-installLocation" value="<LOCATION>" />
<LOCATION> indicates where the application can be installed.
Specifies how the application interacts with the on-screen soft keyboard.
<preference name="android-windowSoftInputMode" value="<INPUTMODE>" />
<INPUTMODE> determines the state and features of the keyboard.
For adding application device permissions.
<preference name="android-permission" value="<PERMISSION"> />
<PERMISSION> is the permission identifier. The list of valid permissions may vary depending on the version of the Android operating system that is targeted. See the Manifest Permission List on the Android Developer site for a complete list of Android permissions.

NOTE: the NETWORK permission will always be part of your Cordova application, even if no Cordova plugins have been included in your application. This is due to the way the Cordova framework communicates ("bridges the gap") between the HTML5 JavaScript layer and the underlying native code layer.

Specifying permissions for your app is optional and is typically NOT required! Hybrid mobile apps (aka Cordova apps) include native code and, therefore, may require specifying native code API permissions. In most cases the permissions required of your app are specified by the plugins included in your app. In some rare cases you may need to add a permission to augment those already specified by your included plugins.
Allows you to indicate if the application will be signed (for distribution in the Android store).
<preference name="android-signed" value="<bool>" />
<bool>indicates whether the application should be signed. A value of " false" indicates the application will not be signed, and " true" indicates the application will be signed. The default is " true".

For more complete information about compiler optimizations, see our Optimization Notice.