@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 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.
Methods
Method details
activityLaunchMode
public abstract String activityLaunchMode() default ""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.appBundle
public abstract Toggle appBundle() default Toggle.DEFAULTbuildToolsVersion
public abstract String buildToolsVersion() default ""captureRecord
public abstract String captureRecord() default ""RECORD_AUDIO permission should be requested. Can be
enabled or any other value to disable this optiondebug
public abstract Toggle debug() default Toggle.DEFAULTWhether to include the debug version in the build.
Left alone, this follows release rather than a fixed value, so a build
that selects neither still produces something installable.
disableR8
public abstract Toggle disableR8() default Toggle.DEFAULTenableProguard
public abstract Toggle enableProguard() default Toggle.DEFAULTgradleDep
public abstract String[] gradleDep() default {}hideStatusBar
public abstract Toggle hideStatusBar() default Toggle.DEFAULTinstallLocation
public abstract InstallLocation installLocation() default InstallLocation.DEFAULTlicenseKey
public abstract String licenseKey() default ""minSdkVersion
public abstract AndroidMinSdk minSdkVersion() default AndroidMinSdk.DEFAULTandroid:minSdkVersion.multidex
public abstract Toggle multidex() default Toggle.DEFAULTMultidex lets an Android binary reference more than 65536 methods.
Set Toggle.OFF to opt out, which builds a little faster and reinstates
the limit.
newFirebaseMessaging
public abstract Toggle newFirebaseMessaging() default Toggle.DEFAULTproguardKeep
public abstract String[] proguardKeep() default {}-keep class com.mypackage.ProblemClass { *; }release
public abstract Toggle release() default Toggle.DEFAULTrepositories
public abstract String[] repositories() default {}targetSDKVersion
public abstract int targetSDKVersion() default 0themeMode
public abstract ThemeMode themeMode() default ThemeMode.DEFAULTauto, 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.topDependency
public abstract String[] topDependency() default {}useAndroidX
public abstract Toggle useAndroidX() default Toggle.DEFAULTxapplication
public abstract String xapplication() default ""xgradle
public abstract String[] xgradle() default {}xpermissions
public abstract String xpermissions() default ""