Annotation Type Android


@Retention(CLASS) @Target(TYPE) public @interface 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 Elements
    Modifier and Type
    Optional Element
    Description
    Allows explicitly setting the android:launchMode attribute of the main activity in android.
    boolean
    Produces an Android App Bundle (.aab) rather than an APK.
    Android build-tools version.
    Indicates whether the RECORD_AUDIO permission should be requested.
    boolean
    true/false defaults to true - indicates whether to include the debug version in the build.
    boolean
    Turns off R8, falling back to the older shrinker.
    boolean
    Boolean true/false defaults to true.
    Gradle dependency statements to add to the app module, such as implementation 'com.example:lib:1.0'.
    boolean
    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 Android
    int
    The least SDK required to run this app, the default value changes based on functionality but can be as low as 7.
    boolean
    Boolean true/false defaults to false.
    boolean
    Uses the current Firebase Cloud Messaging integration.
    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 \n when the hint is written.
    boolean
    true/false defaults to true - indicates whether to include the release version in the build
    Extra Gradle repositories to resolve dependencies from.
    int
    Indicates the Android SDK used to compile the Android build defaults to 21.
    auto, modern / material, hololight (default for existing apps), legacy.
    Statements added to the top-level Gradle build file rather than the app module.
    boolean
    Use Android X instead of support libraries.
    defaults to an empty string.
    Arbitrary text spliced into the generated app-module Gradle file.
    more permissions for the Android manifest
  • Element Details

    • activityLaunchMode

      String activityLaunchMode
      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 https://developer.android.com/guide/topics/manifest/activity-element.html[Android docs for the activity element] for more information about the android:launchMode attribute.
      Default:
      "singleTop"
    • appBundle

      boolean appBundle
      Produces an Android App Bundle (.aab) rather than an APK. Required for new Play Store submissions.
      Default:
      false
    • buildToolsVersion

      String buildToolsVersion
      Android build-tools version. It also selects the compile SDK, so there is no separate compile-SDK hint.
      Default:
      ""
    • captureRecord

      String captureRecord
      Indicates whether the RECORD_AUDIO permission should be requested. Can be enabled or any other value to disable this option
      Default:
      "enabled"
    • debug

      boolean debug
      true/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 disableR8
      Turns off R8, falling back to the older shrinker. Note that hardening requires R8, so this conflicts with harden.level.
      Default:
      false
    • enableProguard

      boolean enableProguard
      Boolean true/false defaults to true. Allows disabling the proguard obfuscation even on release builds, notice that this isn't recommended
      Default:
      true
    • gradleDep

      String[] gradleDep
      Gradle 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 hideStatusBar
      Hides the Android status bar.
      Default:
      false
    • installLocation

      InstallLocation installLocation
      Maps to android:installLocation manifest entry defaults to auto. Can also be set to internalOnly or preferExternal.
      Default:
      AUTO
    • licenseKey

      String licenseKey
      The license key for the Android app, this is required if you use in-app purchase on Android
      Default:
      ""
    • minSdkVersion

      int minSdkVersion
      The 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 attribute android:minSdkVersion.
      Default:
      19
    • multidex

      boolean multidex
      Boolean 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 newFirebaseMessaging
      Uses the current Firebase Cloud Messaging integration. Requires AndroidX and Gradle 8.13 or newer.
      Default:
      true
    • proguardKeep

      String[] proguardKeep
      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 \n when the hint is written.
      Default:
      {}
    • release

      boolean release
      true/false defaults to true - indicates whether to include the release version in the build
      Default:
      true
    • repositories

      String[] repositories
      Extra Gradle repositories to resolve dependencies from. Values are joined with \n when the hint is written.
      Default:
      {}
    • targetSDKVersion

      int targetSDKVersion
      Indicates 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 themeMode
      auto, modern / material, hololight (default for existing apps), legacy. auto and modern / material opt in to the CSS-generated Android Material 3 theme from native-themes/android-material/theme.css. hololight is Android Holo Light (what the framework shipped on API 14+ before this refactor). legacy loads the pre-Holo Android theme. The legacy alias cn1.androidTheme is still accepted, and and.hololight=true still maps to hololight. The default stays on hololight for existing apps until you flip in a future release.
      Default:
      AUTO
    • topDependency

      String[] topDependency
      Statements added to the top-level Gradle build file rather than the app module. Values are joined with \n when the hint is written.
      Default:
      {}
    • useAndroidX

      boolean 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.
      Default:
      false
    • xapplication

      String 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.
      Default:
      ""
    • xgradle

      String[] xgradle
      Arbitrary text spliced into the generated app-module Gradle file. Values are joined with \n when the hint is written.
      Default:
      {}
    • xpermissions

      String xpermissions
      more permissions for the Android manifest
      Default:
      ""