Since many developers use Qt for Android, we want to improve the developer experience. With the upcomingrelease of Qt 5.15.0, we have revamped the documentation for Android. The new documentation has lots of new content on how to use Qt for Android maximizing its full potential. It explains in more detail how to extend Qt to support more advanced features and enhance integration with Android APIs.
The main topics that have been improved in the documentation include:
Extending Qt applications to use custom Java classes or assets and the packaging structure.
Dependency version management between the Android Native Development Kit (NDK)and Qt.
How to work with Android services in a multitude of different ways.
How to buildand use OpenSSL with Android. Dependencies between the OpenSSL repository supports all Qt versions, both with QMake and CMake.
In the same context, many Qt examples that had some issues such as layout, scaling, or permissions, has been fixed. Qt 5.15.0 Qt Android Extras comes with a new code example Qt Java Native Interface Messenger (Qt JNI Messenger). The example demonstrates one of the most important topics when using Qt for Android, which is JNI communication. It explains the workflow of invoking methods and exchanging data between Java and Qt. The example serves as a starting point for bridging Qt and Android both ways.
Ensuringproper integration with Android, the Android native file dialog can now be used by default by opening file(s) and saving operations. The native file dialog also uses Android’s‘content’ file scheme and conductsadditional exception checks, which in the past has causedsome occasional crashes. The AndroidManifest.xml no longer sets minSdkVersion and targetSdkVersion values. Instead, you can setthem with the build.gradle file. Android Studio will provide a warning about setting SDK versions in the manifest file. For more information, see the Manifest documentation.
The latest releaseof Qt CreatorbroughtsubstantialimprovementsforAndroid development. Qt Creator cannow automatically setupfor Android SDK,which is the main block for building and running Qt for Android applications. Itprompts youto install theneededpackages for development. Furthermore, using OpenSSL in your applicationsis now more straightforwardwith Qt Creator,allowing you to set up your local path for the library and use it with any project from the kit settings. One of theessentialfeaturesof Qt forAndroid supportwas thelack ofmanaging Qt and NDK versions.In the past,Qt Creatorcould only haveone valid NDK at a given time, which can be troubling when dealing with multiple Qt versions and projects. Qt for Android versions reliedonthedifferent NDK versions, and it was up to the developer toselectand switch to thecorrect version manually.That is whywe introduced a way to manage multiple Qt versions and couple each of them with the appropriate NDK version. Qt Creator keeps track of this using a common configuration file. Additionally, it is possible to use custom NDK paths as desired.
Some other changes we have made include the examples list for Android kits showing examples that are tested and known to work on Android devices. The examples that are not shown by default include those that have unsupported features or modules on Android, for example. Also, improvements to the UI design and functionality included the AVD Manager, which got some flexibility for creating AVDs, as well as the Manifest Editor’s icon selection.
To serve Qt mobile users well, we are going to introduce many more updates forsupporting Android. We will create more examples, documentation, and functionality, paving the way for easy and advanced development targeted for Android. Stay tuned for brighter Qt for Android future.
To access all the new features with Qt for Android, download the latest version via our downloads page or update through the maintenance tool.