Annotation Type Android
Android build hints, checked by the compiler.
Place this on your application's main class -- the class named by
codename1.mainName. An attribute you do not set is not written at all, so
the builder's own default applies; the values shown here are that default,
for reference.
Generated from com.codename1.build.shared.BuildHints by BuildHintCodeGenerator. Do not edit by hand -- edit the catalog and re-run scripts/gen-build-hint-annotations.sh.
-
Optional Element Summary
Optional ElementsModifier and TypeOptional ElementDescriptionAllows explicitly setting theandroid:launchModeattribute of the main activity in android.booleanProduces an Android App Bundle (.aab) rather than an APK.Android build-tools version.Indicates whether theRECORD_AUDIOpermission should be requested.booleantrue/false defaults to true - indicates whether to include the debug version in the build.booleanTurns off R8, falling back to the older shrinker.booleanBoolean true/false defaults to true.String[]Gradle dependency statements to add to the app module, such as implementation 'com.example:lib:1.0'.booleanHides the Android status bar.Maps to android:installLocation manifest entry defaults to auto.The license key for the Android app, this is required if you use in-app purchase on AndroidintThe least SDK required to run this app, the default value changes based on functionality but can be as low as 7.booleanBoolean true/false defaults to false.booleanUses the current Firebase Cloud Messaging integration.String[]Arguments for the keep option in proguard allowing you to keep a pattern of files for example,-keep class com.mypackage.ProblemClass { *; }Values are joined with\nwhen the hint is written.booleantrue/false defaults to true - indicates whether to include the release version in the buildString[]Extra Gradle repositories to resolve dependencies from.intIndicates the Android SDK used to compile the Android build defaults to 21.auto,modern/material,hololight(default for existing apps),legacy.String[]Statements added to the top-level Gradle build file rather than the app module.booleanUse Android X instead of support libraries.defaults to an empty string.String[]Arbitrary text spliced into the generated app-module Gradle file.more permissions for the Android manifest
-
Element Details
-
activityLaunchMode
String activityLaunchModeAllows explicitly setting theandroid:launchModeattribute 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 https://developer.android.com/guide/topics/manifest/activity-element.html[Android docs for the activity element] for more information about theandroid:launchModeattribute.- Default:
"singleTop"
-
appBundle
boolean appBundleProduces an Android App Bundle (.aab) rather than an APK. Required for new Play Store submissions.- Default:
false
-
buildToolsVersion
String buildToolsVersionAndroid build-tools version. It also selects the compile SDK, so there is no separate compile-SDK hint.- Default:
""
-
captureRecord
String captureRecordIndicates whether theRECORD_AUDIOpermission should be requested. Can beenabledor any other value to disable this option- Default:
"enabled"
-
debug
boolean debugtrue/false defaults to true - indicates whether to include the debug version in the build. Defaults conditionally rather than to a fixed value: when android.release is on it defaults to false, and when release is off it defaults to true, so a build that selects neither still produces something installable (AndroidGradleBuilder.java:447-451).- Default:
false
-
disableR8
boolean disableR8Turns off R8, falling back to the older shrinker. Note that hardening requires R8, so this conflicts with harden.level.- Default:
false
-
enableProguard
boolean enableProguardBoolean true/false defaults to true. Allows disabling the proguard obfuscation even on release builds, notice that this isn't recommended- Default:
true
-
gradleDep
String[] gradleDepGradle dependency statements to add to the app module, such as implementation 'com.example:lib:1.0'. Values are joined with;when the hint is written.- Default:
{}
-
hideStatusBar
boolean hideStatusBarHides the Android status bar.- Default:
false
-
installLocation
InstallLocation installLocationMaps to android:installLocation manifest entry defaults to auto. Can also be set to internalOnly or preferExternal.- Default:
AUTO
-
licenseKey
String licenseKeyThe license key for the Android app, this is required if you use in-app purchase on Android- Default:
""
-
minSdkVersion
int minSdkVersionThe least 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 attributeandroid:minSdkVersion.- Default:
19
-
multidex
boolean multidexBoolean true/false defaults to false. Multidex allows Android binaries to reference more than 65536 methods. This slows builds a bit so you have it off by default but if you get a build error mentioning this limit you should turn this on.- Default:
true
-
newFirebaseMessaging
boolean newFirebaseMessagingUses the current Firebase Cloud Messaging integration. Requires AndroidX and Gradle 8.13 or newer.- Default:
true
-
proguardKeep
String[] proguardKeepArguments for the keep option in proguard allowing you to keep a pattern of files for example,-keep class com.mypackage.ProblemClass { *; }Values are joined with\nwhen the hint is written.- Default:
{}
-
release
boolean releasetrue/false defaults to true - indicates whether to include the release version in the build- Default:
true
-
repositories
String[] repositoriesExtra Gradle repositories to resolve dependencies from. Values are joined with\nwhen the hint is written.- Default:
{}
-
targetSDKVersion
int targetSDKVersionIndicates the Android SDK used to compile the Android build 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.- Default:
0
-
themeMode
AndroidThemeMode themeModeauto,modern/material,hololight(default for existing apps),legacy.autoandmodern/materialopt in to the CSS-generated Android Material 3 theme fromnative-themes/android-material/theme.css.hololightis Android Holo Light (what the framework shipped on API 14+ before this refactor).legacyloads the pre-Holo Android theme. The legacy aliascn1.androidThemeis still accepted, andand.hololight=truestill maps tohololight. The default stays onhololightfor existing apps until you flip in a future release.- Default:
AUTO
-
topDependency
String[] topDependencyStatements added to the top-level Gradle build file rather than the app module. Values are joined with\nwhen the hint is written.- Default:
{}
-
useAndroidX
boolean useAndroidXUse 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.- Default:
false
-
xapplication
String xapplicationdefaults 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.- Default:
""
-
xgradle
String[] xgradleArbitrary text spliced into the generated app-module Gradle file. Values are joined with\nwhen the hint is written.- Default:
{}
-
xpermissions
-