Qt Android Manifest File Configuration
The Android Manifest is an XML file necessary for any Android app. It contains app configuration for different settings and features that the app use, as well as details on the app itself, such as, package name, app name, version, etc. Permissions and hardware features can also be set from the manifest.
Qt for Android maintains a version of
AndroidManifest.xml with default configuration that include features, permissions and other configuration used by the build system which are needed for building and running Qt apps on Android.
Qt defines some meta-data that is passed from the build systems and to androiddeployqt which populates the manifest with the correct values without explicitly setting these in the manifest file. Such meta-data is assigned a value in the form
"-- %%INSERT_VALUE%% --", for example:
<manifest ... android:versionCode="-- %%INSERT_VERSION_CODE%% --" ... </manifest>
This would be populated with the version code that is set in, for example,
Qt sets the following manifest configuration by default:
|<manifest>||package||Sets the package name. Default: |
|Sets the app's installation location, whether internal or external storage. Default: |
|android:versionCode||Sets the internal version code. Populated from |
|android:versionName||Sets the public version name. Populated from |
|Sets the screen sizes that the app supports, default values are |
|<application>||android:name||The application class name. Default: |
|android:label||The application name label. Default: the Qt project's target name.|
|android:extractNativeLibs||Extracts the native C++ libraries on installation. Default: |
|android:hardwareAccelerated||Sets hardware accelaration preference. Default: |
|android:requestLegacyExternalStorage||Whether to use Android scoped storage. Default |
|<activity>||android:name||The activity class name. Default: |
|android:label||The activity name label. Default: the Qt project's target name.|
|android:configChanges||Lists configuration changes that the activity handles. Default: |
|android:launchMode||The method used to launch the activity. Default: |
|android:screenOrientation||The orientation of the activity's display on the device. Default: |
|<intent-filter>||Specifies the types of intents that the activity can respond to. Default:|
<action android:name="android.intent.action.MAIN"/> <category android:name="android.intent.category.LAUNCHER"/>
In addition to the default manifest configuration that Qt sets, Qt defines some meta-data that is valid for Qt apps only. Such meta-data is usually under the
<activity> section in the form:
<meta-data android:name="meta-data-name" android:value="meta-data-value" />
The following is a list of such meta-data defined by Qt:
|android.app.lib_name||The filename of the native C++ library that is used by the activity.|
Note: This attribute is mandatory and shouldn't be removed. Default: the Qt project's target name.
|android.app.extract_android_style||The method used to extract the native Android Style information. For more information, see Style Extraction. Default: |
|android.app.background_running||Sets whether the app keeps running tasks in the background. Setting this to |
|android.app.arguments||Sets a list of arguments to pass to the app |
|android.app.splash_screen_drawable_portrait||Sets a drawable for a splash screen specific to portrait mode. For example: |
|android.app.splash_screen_drawable_landscape||Sets a drawable for a splash screen specific to landscape mode. For example: |
|android.app.splash_screen_drawable||Sets a drawable for a splash screen at the start of the app.|
Note: Orientation specific splash screens are checked first, if not set, this is used instead. For example:
|android.app.splash_screen_sticky||Sets whether the splash screen stays visible until explicitly hidden by the app. For more information, see QAndroidApplication::hideSplashScreen(). Default: |
|android.app.system_libs_prefix||Specifies a custom system library path to use for library loading lookup. This is necessary when running as a system app. Default: |
Some meta-data attributes can also be used in Services. The main ones are:
Different Qt modules might require some Android permissions or features to function properly, for example, Camera permission in QtMultimedia. The androiddeployqt tool takes care of including such requirements into the Android manifest during the build. Qt defines the following lines into the manifest, which they get replaced by the actual values:
<manifest ... <!-- %%INSERT_PERMISSIONS --> <!-- %%INSERT_FEATURES --> ... </manifest>
Note: If those lines are removed from the project manifest, Qt won't be able to include the correct permissions. So some functionalities might not work properly.
Qt uses different methods to determine how Qt Widgets and Qt Quick Controls should be styled:
full: when using Qt Widgets or Qt Quick Controls 1.
Note: This method uses some Android non-SDK interfaces, that are being restricted and removed by Google starting from Android 9.0 (API 28). For that reason, this is not recommended for Android 9.0 or greater.
minimal: when using Qt Quick Controls 2 and no Qt Widgets or Qt Quick Controls 1. This is faster than using the default or full options.
none: no style extraction.
Versions of Qt earlier than 6.2 used to have an additional set of meta-data defined by Qt. These attributes used to manage dependencies and some were used by the discontinued
Ministro service. With Qt 6.2, they should be removed. Here is a list of these attributes:
For more information on the Android Manifest, see Android App Manifest.
© 2021 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.