Codename One Developer Guide

android.debug

true/false defaults to true – indicates whether to include the debug version in the build

android.release

true/false defaults to true – indicates whether to include the release version in the build

android.installLocation

Maps to android:installLocation manifest entry defaults to auto. Can also be set to internalOnly or preferExternal.

android.gradle

Deprecated, this mode is no longer supported. true/false defaults to false prior to 3.3 and true after. Uses Gradle instead of Ant to build the Android app

android.xapplication

defaults to an empty string. Allows developers of native Android code to add text within the application block to define things such as widgets, services etc.

android.permission.PERMISSION_NAME

true/false Whether to include a particular permission. Use of these build hints is preferred to android.xpermissions since they avoid possible conflicts with libraries. See Android’s Manifest.permission docs for a full list of permissions.

android.permission.PERMISSION_NAME.maxSdkVersion

Will be translated to the maxSdkVersion attribute of the tag for the corresponding android.permission.PERMISSION_NAME build hint. (Optional)

android.permission.PERMISSION_NAME.required

true/false Will be translated to the required attribute of the tag for the corresponding android.permission.PERMISSION_NAME build hint. (Optional)

android.xpermissions

additional permissions for the Android manifest

android.xintent_filter

Allows adding an intent filter to the main android activity

android.activity.launchMode

Allows explicitly setting the android:launchMode attribute of the main activity in android. Default is “singleTop”, but for some applications you may need to change this behaviour. In particular, apps that are meant to open a file type will need to set this to “singleTask”. See Android docs for the activity element for more information about the android:launchMode attribute.

android.licenseKey

The license key for the Android app, this is required if you use in-app-purchase on Android

android.stack_size

Size in bytes for the Android stack thread

android.statusbar_hidden

true/false defaults to false. When set to true hides the status bar on Android devices.

android.facebook_permissions

Permissions for Facebook used in the Android build target, applicable only if Facebook native integration is used.

android.googleAdUnitId

Allows integrating admob/google play ads, this is effectively identical to google.adUnitId but only applies to Android

android.googleAdUnitTestDevice

Device key used to mark a specific Android device as a test device for Google Play ads defaults to C6783E2486F0931D9D09FABC65094FDF

android.includeGPlayServices

Deprecated, please android.playService.*! Indicates whether Goolge Play Services should be included into the build, defaults to false but that might change based on the functionality of the application and other build hints. Adding Google Play Services support allows us to use a more refined location implementation and invoke some Google specific functionality from native code.

android.playService.plus, android.playService.auth, android.playService.base, android.playService.identity, android.playService.indexing, android.playService.appInvite, android.playService.analytics, android.playService.cast, android.playService.gcm, android.playService.drive, android.playService.fitness, android.playService.location, android.playService.maps, android.playService.ads, android.playService.vision, android.playService.nearby, android.playService.panorama, android.playService.games, android.playService.safetynet, android.playService.wallet, android.playService.wearable

Allows including only a specific play services library portion. Notice that this setting conflicts with the deprecated android.includeGPlayServices and only works with the gradle build (which is on by default but can be toggled using android.gradle).

If none of the services are defined to true then plus, auth, base, analytics, gcm, location, maps & ads will be set to true. If one or more of the android.playService entries are defined to something then all entries will default to false.

android.playServicesVersion

The version number of play services to build against. Experimental. Use with caution as building against versions other than the server default may introduce incompatibilities with some Codename One APIs.

xxx.minPlayServicesVersion

This is a special case build hint. You can use any prefix to the build hint and the convention is to use your cn1lib name. It’s identical to android.minPlayServicesVersion with the exception that the “highest version wins”. That way if your cn1lib requires play services 9+ and uses: myLib.minPlayServicesVersion=9.0.0 and another library has otherLib.minPlayServicesVersion=10.0.0 then play services will be 10.0.0

android.multidex

Boolean true/false defaults to false. Multidex allows Android binaries to reference more than 65536 methods. This slows builds a bit so we have it off by default but if you get a build error mentioning this limit you should turn this on.

android.headphoneCallback

Boolean true/false defaults to false. When set to true it assumes the main class has two methods: headphonesConnected & headphonesDisconnected which it invokes appropriately as needed

android.gpsPermission

Indicates whether the GPS permission should be requested, it is auto-detected by default if you use the location API. However, some code might want to explicitly define it

android.asyncPaint

Boolean true/false defaults to true. Toggles the Android pipeline between the legacy pipeline (false) and new pipeline (true)

android.stringsXml

Allows injecting additional entries into the strings.xml file using a value that includes something like this`value1value2`

android.supportV4

Boolean true/false defaults to false but that can change based on usage (e.g. push implicitly activates this). Indicates whether the android support v4 library should be included in the build

android.style

Allows injecting additional data into the styles.xml file right before the closing resources tag

android.cusom_layout1

Applies to any number of layouts as long as they are in sequence (e.g. android.cusom_layout2, android.cusom_layout3 etc.). Will write the content of the argument as a layout xml file and give it the name cusom_layout1.xml onwards. This can be used by native code to work with XML files

android.keyboardOpen

Boolean true/false defaults to true. Toggles the new async keyboard mode that leaves the keyboard open while we move between text components

android.versionCode

Allows overriding the auto generated version number with a custom internal version number specifically used for the xml attribute android:versionCode

android.captureRecord

Indicates whether the RECORD_AUDIO permission should be requested. Can be enabled or any other value to disable this option

android.nonconsumable

Comma delimited string of items that are non-consumable in the in-app-purchase API

android.removeBasePermissions

Boolean true/false defaults to false. Disables the builtin permissions specifically INTERNET permission (i.e. no networking…​)

android.blockExternalStoragePermission

Boolean true/false defaults to false. Disables the external storage (SD card) permission

android.min_sdk_version

The minimum SDK required to run this app, the default value changes based on functionality but can be as low as 7. This corresponds to the XML attribute android:minSdkVersion.

android.mockLocation

Boolean true/false defaults to true. Toggles the mock location permission which is on by default, this allows easier debugging of Android device location based services

android.smallScreens

Boolean true/false defaults to true. Corresponds to the android:smallScreens XML attribute and allows disabling the support for very small phones

android.xapplication_attr

Allows injecting additional attributes into the application` tag in the Android XML

android.xactivity

Allows injecting additional attributes into the activity tag in the Android XML

android.streamMode

The mode in which the volume key should behave, defaults to OS default. Allows setting it to music for music playback apps

android.pushVibratePattern

Comma delimited long values to describe the push pattern of vibrate used for the setVibrate native method

android.enableProguard

Boolean true/false defaults to true. Allows disabling the proguard obfuscation even on release builds, notice that this isn’t recommended

android.proguardKeep

Arguments for the keep option in proguard allowing us to keep a pattern of files e.g. -keep class com.mypackage.ProblemClass { *; }

android.shrinkResources

Boolean true/false defaults to false. Used only in conjunction with android.enableProguard. Strips out unused resources to reduce apk size. Since 7.0

android.sharedUserId

Allows adding a manifest attribute for the sharedUserId option

android.sharedUserLabel

Allows adding a manifest attribute for the sharedUserLabel option

android.targetSDKVersion

Indicates the Android SDK used to compile the Android build currently defaults to 21. Notice that not all targets will work since the source might have some limitations and not all SDK targets are installed on the build servers.

android.useAndroidX

Use Android X instead of support libraries. This will also run a find/replace on all source files to replace support libraries and artifacts with AndroidX equivalents.

android.theme

Light or Dark defaults to Light. On Android 4+ the default Holo theme is used to render the native widgets in some cases and this indicates whether holo light or holo dark is used. Currently this doesn’t affect the Codename One theme but that might change in the future.

android.web_loading_hidden

true/false defaults to false – set to true to hide the progress indicator that appears when loading a web page on Android.

block_server_registration

true/false flag defaults to false. By default Codename One applications register with our server, setting this to true blocks them from sending information to our cloud. We keep this data for statistical purposes and intend to provide additional installation stats in the future.

facebook.appId

The application ID for an app that requires native Facebook login integration, this defaults to null which means native Facebook support shouldn’t be in the app

gcm.sender_id

The Android/chrome push identifier, see the push section for more details

android.background_push_handling

Deliver push messages on Android when the app is minimized by setting this to “true”. Default behaviour is to deliver the message only if the app is in the foreground when received, or after the user taps on the notification to open the app, if the app was in the background when the message was received.

desktop.mac.plist.PLISTKEY

Set the key PLISTKEY in the Info.plist file for desktop mac build. E.g. desktop.mac.plist.LSApplicationCategoryType=public.app-category.business. See Apple Documentation of Info.plist keys and values for a full list of supported keys. + Currently only supported for App Store builds. See Mac OS Desktop Build Options for more information.

desktop.mac.plistInject

Injects raw XML into the Info.plist file for desktop builds. E.g. desktop.mac.plistInject=LSApplicationCategoryTypepublic.app-category.business + Currently only supported for App Store builds. See Mac OS Desktop Build Options for more information.

ios.associatedDomains

Comma-delimited list of domains associated with this app. Since 6.0. Note that each domain should be prefixed by a supported prefix. E.g. “applinks:” or “webcredentials:”. See Apple’s documentation on Associated domains for more information.

ios.bitcode

true/false defaults to false. Enables bitcode support for the build.

ios.debug.archs

Can be set to “arm64” to force iOS debug builds to be 64 bit. By default, debug builds are 32 bit in order to shorten build-times and maintain compatibility with older devices.

ios.distributionMethod

Specifies distribution type for debug iOS builds. This is generally used for enterprise or ad-hoc builds (using values “enterprise” and “ad-hoc” respectively).

ios.debug.distributionMethod

Specifies distribution type for debug iOS builds only. This is generally used for enterprise or ad-hoc builds (using values “enterprise” and “ad-hoc” respectively).

ios.release.distributionMethod

Specifies distribution type for release iOS builds only. This is generally used for enterprise or ad-hoc builds (using values “enterprise” and “ad-hoc” respectively).

ios.keyboardOpen

Flips between iOS keyboard open mode and auto-fold keyboard mode. Defaults to true which means the keyboard will remain open and not fold automatically when editing moves to another field.

ios.urlScheme

Allows intercepting a URL call using the syntax urlPrefix

ios.useAVKit

Use AVKit for video components on iOS rather than MPMoviePlayerController on iOS versions 8 through 12. iOS 13 will always use AVKit, and iOS 7 and lower will always use MPMoviePlayerController. Default value false

ios.teamId

Specifies the team ID associated with the iOS provisioning profile and certificate. Use ios.debug.teamId and ios.release.teamId to specify different team IDs for debug and release builds respectively.

ios.debug.teamId

Specifies the team ID associated with the iOS debug provisioning profile and certificate.

ios.release.teamId

Specifies the team ID associated with the iOS release provisioning profile and certificate.

ios.project_type

one of ios, ipad, iphone (defaults to ios). Indicates whether the resulting binary is targeted to the iphone only or ipad only. Notice that the IDE plugin has a “Project Type” combo box you should use under the iOS section.

ios.rpmalloc

true/false Use rpmalloc instead of malloc/free for memory allocation in ParparVM. This will cause the deployment target to be changed to a minimum of iOS 8.0.

ios.statusbar_hidden

true/false defaults to false. Hides the iOS status bar if set to true.

ios.newStorageLocation

true/false defaults to false but defined on new projects as true by default. This changes the storage directory on iOS from using caches to using the documents directory which is more correct but might break compatibility. This is described in this issue

ios.prerendered_icon

true/false defaults to false. The iOS build process adapts the submitted icon for iOS conventions (adding an overlay) that might not be appropriate on some icons. Setting this to true leaves the icon unchanged (only scaled).

ios.app_groups

Space-delimited list of app groups that this app belongs to as described in Apple’s documentation. These are added to the entitlements file with key com.apple.security.application-groups.

ios.keychainAccessGroup

Space-delimited list of keychain access groups that this app has access to as described in Apple’s documentation. These are added to the entitlements file with the key keychain-access-groups.

ios.application_exits

true/false (defaults to false). Indicates whether the application should exit immediately on home button press. The default is to exit, leaving the application running is only partially tested at the moment.

ios.blockScreenshotsOnEnterBackground

true/false (defaults to false). Indicates that app should prevent iOS from taking screenshots when app enters background. Described here.

ios.applicationQueriesSchemes

Comma separated list of url schemes that canExecute will respect on iOS. If the url scheme isn’t mentioned here canExecute will return false starting with iOS 9. Notice that this collides with ios.plistInject when used with the LSApplicationQueriesSchemes…​ value so you should use one or the other. E.g. to enable canExecute for a url like myurl://xys you can use: myurl,myotherurl

ios.themeMode

default/legacy/modern/auto (defaults to default). Default means you don’t define a theme mode. Currently this is equivalent to legacy. In the future we will switch this to be equivalent to auto. legacy – this will behave like iOS 6 regardless of the device you are running on. modern – this will behave like iOS 7 regardless of the device you are running on. auto – this will behave like iOS 6 on older devices and iOS 7 on newer devices.

ios.interface_orientation

UIInterfaceOrientationPortrait by default. Indicates the orientation, one or more of (separated by colon :): UIInterfaceOrientationPortrait, UIInterfaceOrientationPortraitUpsideDown, UIInterfaceOrientationLandscapeLeft, UIInterfaceOrientationLandscapeRight. Notice that the IDE plugin has an “Interface Orientation” combo box you should use under the iOS section.

ios.xcode_version

The version of xcode used on the server. Defaults to 4.5; currently accepts 5.0 as an option and nothing else.

ios.multitasking

Set to true to enable iOS multitasking and split-screen support. This only works if ios.xcode_verson=9.2.

java.version

Valid values include 5 or 8. Indicates the JVM version that should be used for server compilation, this is defined by default for newly created apps based on the Java 8 mode selection

javascript.inject_proxy

true/false (defaults to true) By default, the build server will configure the .war version of your app to use the bundled proxy servlet for HTTP requests (to get around same-origin restrictions on network requests). Setting this to false prevents this, causing the application to make network requests without a proxy.

javascript.inject.beforeHead

Content to be injected into the index.html file at the beginning of the tag.

javascript.inject.afterHead

Content to be injected into the index.html file at the end of the tag.

javascript.minifying

true/false (defaults to true). By default the javascript code is minified to reduce file size. You may optionally disable minification by setting javascript.minifying to false.

javascript.proxy.url

The URL to the proxy servlet that should be used for making network requests. If this is omitted, the .war version of the app will be set to use the bundled proxy servlet, and the .zip version of the app will be set to use no proxy. If javascript.inject_proxy is false, this build-hint will be ignored.

javascript.sourceFilesCopied

true/false (defaults to false). Setting this flag to true will cause available java source files to be included in the resulting .zip and .war files. These may be used by Chrome during debugging.

javascript.stopOnErrors

true/false (defaults to true). Cause javascript build to fail if there are warnings during the build. In some cases build warnings won’t affect the running of the app. E.g. if the Javascript port is missing a method that the app depends on, but it isn’t used in most of the app. Or if there is multithreaded code detected in static initializers, but that code-path isn’t used by the app. Setting this to false may allow you to get past some build errors, but it might just result in runtime errors later on, which are much more difficult to debug. *This build hint is only available in Codename One 3.4 and later.

javascript.teavm.version

(Optional) The version of TeaVM to use for the build. Use caution, only use this property if you know what you are doing!

rim.askPermissions

true/false defaults to true. Indicates whether the user is prompted for permissions on Blackberry devices.

google.adUnitId

Allows integrating Admob/Google Play ads into the application see this

rim.ignor_legacy

true/false defaults to false. When set to true the Blackberry build targets only 5.0 devices and newer and doesn’t build the 4.x version. rim.nativeBrowser true/false defaults to false. Enables the native blackberry browser on OS 5 or higher. It is disabled by default since it might casue crashes on some cases.

rim.obfuscation

true/false defaults to false. Obfuscate the JAR before invoking the rimc compiler.

ios.plistInject

entries to inject into the iOS plist file during build.

ios.includePush

true/false (defaults to false). Whether to include the push capabilities in the iOS build. Notice that the IDE plugin has an “Include Push” check box you should use under the iOS section.

ios.newPipeline

Boolean true/false defaults to true. Allows toggling the OpenGL ES 2.0 drawing pipeline off to the older OGL ES 1.0 pipeline.

ios.headphoneCallback

Boolean true/false defaults to false. When set to true it assumes the main class has two methods: headphonesConnected & headphonesDisconnected which it invokes appropriately as needed

ios.facebook_permissions

Permissions for Facebook used in the Android build target, applicable only if Facebook native integration is used.

ios.applicationDidEnterBackground

Objective-C code that can be injected into the iOS callback method (message) applicationDidEnterBackground.

ios.enableAutoplayVideo

Boolean true/false defaults to false. Makes videos “auto-play” when loaded on iOS

ios.googleAdUnitId

Allows integrating admob/google play ads, this is effectively identical to google.adUnitId but only applies to iOS

ios.viewDidLoad

Objective-C code that can be injected into the iOS callback method (message) viewDidLoad

ios.googleAdUnitIdPadding

Indicates the amount of padding to pass to the Google ads placed at the bottom of the screen with google.adUnitId

ios.enableBadgeClear

Boolean true/false defaults to true. Clears the badge value with every load of the app, this is useful if the app doesn’t manually keep track of number values for the badge

ios.glAppDelegateHeader

Objective-C code that can be injected into the iOS app delegate at the top of the file. E.g. if you need to include headers or make special imports for other injected code

ios.glAppDelegateBody

Objective-C code that can be injected into the iOS app delegate within the body of the file before the end. This only makes sence for methods that aren’t already declared in the class

ios.beforeFinishLaunching

Objective-C code that can be injected into the iOS app delegate at the top of the body of the didFinishLaunchingWithOptions callback method

ios.afterFinishLaunching

Objective-C code that can be injected into the iOS app delegate at the bottom of the body of the didFinishLaunchingWithOptions callback method

ios.locationUsageDescription

This flag is required for iOS 8 and newer if you are using the location API. It needs to include a description of the reason for which you need access to the users location

ios.NSXXXUsageDescription

iOS privacy flags for using certain APIs. Starting with Xcode 8, you are required to add usage description strings for certain APIs. Find a full list of the available keys in Apple’s docs. Some relevant ones include ios.NSCameraUsageDescription, ios.NSContactsUsageDescription, ios.NSLocationAlwaysUsageDescription, NSLocationUsageDescription, ios.NSMicrophoneUsageDescription, ios.NSPhotoLibraryAddUsageDescription, ios.NSSpeechRecognitionUsageDescription, ios.NSSiriUsageDescription

ios.add_libs

A semicolon separated list of libraries that should be linked to the app in order to build it

ios.pods

A comma separated list of Cocoa Pods that should be linked to the app in order to build it. E.g. AFNetworking ~> 2.6, ORStackView ~> 3.0, SwiftyJSON ~> 2.3

ios.pods.platform

Sets the Cocoapods ‘platform’ for the Cocoapods. Some Cocoapods require a minimum platform level. E.g. ios.pods.platform=7.0.

ios.deployment_target

Sets the deployment target for iOS builds. This is the minimum version of iOS required by a device to install the app. E.g. ios.deployment_target=8.0. Default is ‘6.0’. Note: This build hint interacts with the ios.rpmalloc build hint. If ios.deployment_target is 8.0 or higher, ParparVM will use rpmalloc by default. You can disable this default and revert back to using malloc/free by setting the ios.rpmalloc=false build hint.

ios.bundleVersion

Indicates the version number of the bundle, this is useful if you want to create a minor version number change for the beta testing support

ios.objC

Added the -ObjC compile flag to the project files which some native libraries require

ios.testFlight

Boolean true/false defaults to false and works only for pro accounts. Enables the testflight support in the release binaries for easy beta testing. Notice that the IDE plugin has a “Test Flight” check box you should use under the iOS section.

ios.generateSplashScreens

Boolean true/false defaults to false as of 5.0. Enable legacy generation of splash screen images for use when launching the app. These have been replaced now by the new launch storyboards.

desktop.width

Width in pixels for the form in desktop builds, will be doubled for retina grade displays. Defaults to 800.

desktop.height

Height in pixels for the form in desktop builds, will be doubled for retina grade displays. Defaults to 600.

desktop.adaptToRetina

Boolean true/false defaults to true. When set to true some values will ve implicitly doubled to deal with retina displays and icons etc. will use higher DPI’s

desktop.resizable

Boolean true/false defaults to true. Indicates whether the UI in the desktop build is resizable

desktop.fontSizes

Indicates the sizes in pixels for the system fonts as a comma delimited string containing 3 numbers for small,medium,large fonts.

desktop.theme

Name of the theme res file (without the “.res” extension) to use as the “native” theme. By default this is native indicating iOS theme on Mac and Windows Metro on Windows. If its something else then the app will try to load the file /themeName.res (placed in native/javase directory).

desktop.themeMac

Same as desktop.theme but specific to Mac OS

desktop.themeWin

Same as desktop.theme but specific to Windows

desktop.windowsOutput

Can be exe or msi depending on desired results

windows.extensions

Content to be embedded into the section of the Package.appxmanifest file for windows (UWP) builds.

win.vm32bit

true/false (defaults to false). Forces windows desktop builds to use the Win32 JVM instead of the 64 bit VM making them compatible with older Windows Machines. This is off by default at the moment because of a bug in JDK 8 update 112 that might cause this to fail for some cases

noExtraResources

true/false (defaults to false). Blocks codename one from injecting its own resources when set to true, the only effect this has is in slightly reducing archive size. This might have adverse effects on some features of Codename One so it isn’t recommended.

j2me.iconSize

Defaults to 48×48. The size of the icon in the format of width x height (without the spacing).

Source