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 build server's own default applies. The default clause below each
attribute names a constant that says nothing -- see HintUnset -- and this
package deliberately does not record what the server would do instead,
because that is the server's to change.
The platform is stated once on the annotation, not on every attribute. An attribute repeats it only to disagree with it.
-
Optional Element Summary
Optional ElementsModifier and TypeOptional ElementDescriptionAllows explicitly setting theandroid:launchModeattribute of the main activity in android.Produces an Android App Bundle (.aab) rather than an APK.Android build-tools version.Indicates whether theRECORD_AUDIOpermission should be requested.Whether to include the debug version in the build.Turns off R8, falling back to the older shrinker.Boolean true/false defaults to true.String[]Gradle dependency statements to add to the app module, such as implementation 'com.example:lib:1.0'.Hides 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 AndroidThe least SDK required to run this app, the default value changes based on functionality but can be as low as 7.Multidex lets an Android binary reference more than 65536 methods.Uses 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 { *; }true/false defaults to true - indicates whether to include the release version in the buildString[]Extra Gradle repositories to resolve dependencies from.intThe Android SDK the build compiles against.auto,modern/material,hololight(default for existing apps),legacy.String[]Statements added to the top-level Gradle build file rather than the app module.Use 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:
""
-
appBundle
Toggle appBundleProduces an Android App Bundle (.aab) rather than an APK. Required for new Play Store submissions.- Default:
DEFAULT
-
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:
""
-
debug
-
disableR8
Toggle disableR8Turns off R8, falling back to the older shrinker. Note that hardening requires R8, so this conflicts with harden.level.- Default:
DEFAULT
-
enableProguard
Toggle enableProguardBoolean true/false defaults to true. Allows disabling the proguard obfuscation even on release builds, notice that this isn't recommended- Default:
DEFAULT
-
gradleDep
String[] gradleDepGradle dependency statements to add to the app module, such as implementation 'com.example:lib:1.0'.- Default:
{}
-
hideStatusBar
-
installLocation
InstallLocation installLocationMaps to android:installLocation manifest entry defaults to auto. Can also be set to internalOnly or preferExternal.- Default:
DEFAULT
-
licenseKey
String licenseKeyThe license key for the Android app, this is required if you use in-app purchase on Android- Default:
""
-
minSdkVersion
AndroidMinSdk 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:
DEFAULT
-
multidex
Toggle multidexMultidex lets an Android binary reference more than 65536 methods.
Set
Toggle.OFFto opt out, which builds a little faster and reinstates the limit.- Default:
DEFAULT
-
newFirebaseMessaging
Toggle newFirebaseMessagingUses the current Firebase Cloud Messaging integration. Requires AndroidX and Gradle 8.13 or newer.- Default:
DEFAULT
-
proguardKeep
String[] proguardKeepArguments for the keep option in proguard allowing you to keep a pattern of files for example,-keep class com.mypackage.ProblemClass { *; }- Default:
{}
-
release
Toggle releasetrue/false defaults to true - indicates whether to include the release version in the build- Default:
DEFAULT
-
repositories
-
targetSDKVersion
int targetSDKVersionThe Android SDK the build compiles against. Unset, the build server uses the highest platform it has installed, so leaving this alone tracks the server rather than pinning a number. Not every target works: the source may have limitations, and not all SDK targets are installed.- Default:
0
-
themeMode
ThemeMode 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:
DEFAULT
-
topDependency
String[] topDependencyStatements added to the top-level Gradle build file rather than the app module.- Default:
{}
-
useAndroidX
Toggle 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:
DEFAULT
-
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
-
xpermissions
-