The basis of this approach is to offer Qt QML APIs in an embedded way so that the app will remain a relatively typical Android app. This approach offers a more standard Android-centered approach at the cost of leveraging the cross-platform nature of a Qt application. It's best suited for adding desirable Qt features to an existing Android application.
The most prominent difference between these approaches is the project structure. Qt for Android applications are CMake projects that can be built for Android or other platforms, while a Qt Quick for Android Project is an Android project that includes QML content and can only be built for Android.
The main objective of the Qt for Android approach is to let Qt handle most of the work of the architecture and boilerplate code of the app and let you focus on the content. It offers a complete and reliable cross-platform approach.
See How Qt for Android Works for further details on Qt for Android's architecture.
Qt Quick for Android offers you Android APIs that enable you to insert QML content as an Android View in your project.
These are the public Java and Kotlin APIs that you will use in an Android app to embed QML.
Note: See the QT_ANDROID_GENERATE_JAVA_QTQUICKVIEW_CONTENTS CMake variable for further information on Java code generation of QML components.
The Qt Quick for Android API examples are provided as Android Studio projects. The project folders are found in your Qt install location.
For example, under the default Windows install path, they are found here:
C:\Qt\Examples\Qt-/1\platforms\android
The Qt Gradle Plugin and Qt Tools for Android Studio plugin are provided by Qt for easy development. You can use the Gradle Plugin independently from an IDE as part of your build toolchain. Qt Tools for Android Studio uses the plugin to build your projects in Android Studio.
The following additional topics apply to Qt Quick For Android:
Tutorial on using Qt Quick Views in Android Fragments |
© The Qt Company Ltd
Licensed under the GNU Free Documentation License, Version 1.3.
https://doc.qt.io/qt-6.9/qtquick-for-android.html