Qt 5.15 LTS and Qt for Android
Since many developers use Qt for Android, Qt wants to improve the developer experience. With the next release of Qt 5.15.0, the Qt developers have updated the Android documentation. The updated documentation contains a lot of new content on how to use Qt for Android to maximize its potential. It explains in more detail how to extend Qt to support more advanced features and better integration with Android APIs.
The main topics that have been improved in the documentation are:
• Extending Qt applications to use custom Java classes or assets and packaging structures.
• Versioning dependencies between Android Native Development Kit (NDK) and Qt.
• How to work with Android services in many different ways.
• How to create and use OpenSSL with Android. Dependencies between the OpenSSL repository support all versions of Qt, with both QMake and CMake.
In the same context, a lot of Qt examples that had some issues like layout, scaling, or resolutions were fixed. Qt 5.15.0 Qt Android Extras ships with a new Qt Java Native Interface Messenger (Qt JNI Messenger) sample code. The example demonstrates one of the most important topics when using Qt for Android, namely JNI communication. It explains the workflow of method invocation and data exchange between Java and Qt. The example serves as a starting point for connecting Qt and Android in both directions.
While properly integrating with Android, the Android Native Files dialog can now be used by default to open files and save operations. The native file dialog also uses Android's 'content' file scheme for file content and does additional exception checks that have caused some random crashes in the past. AndroidManifest.xml no longer sets minSdkVersion and targetSdkVersion. Instead, you can install them using the build.gradle file. Android Studio will issue a warning about setting up SDK versions in the manifest file.
Qt Creator 4.12
The latest release of Qt Creator has brought significant improvements to Android development. Qt Creator can now automatically install the Android SDK, which is the main building block for building and running Qt Android applications. It will prompt you to install the required development packages. What's more, using OpenSSL in your applications is now easier with Qt Creator, which allows you to set a local library path and use it with any project from the kit's settings.
One of the significant features of Qt support for Android was the lack of Qt and NDK version control. In the past, Qt Creator could only have one valid NDK, which can be a concern these days when dealing with multiple versions and projects of Qt. The Android versions of Qt relied on different versions of the NDK and the developer had to select and switch to the correct version manually. That's why the Qt developers introduced a way to manage multiple versions of Qt and link each of them to the corresponding version of the NDK. Qt Creator keeps track of this using a shared configuration file. You can also use your own NDK paths if you wish.
Some other changes that the Qt developers have made include a list of examples for Android kits showing examples that have been tested and work on Android devices. For example, examples that are not shown by default include those that have unsupported features or modules on Android. In addition, improvements to the design and functionality of the user interface included AVD Manager , which gained some flexibility in creating AVDs, as well as selection of Manifest Editor icons.
A look into the future
In order to serve Qt's mobile users well, Qt is going to provide many more updates to Android support. The Qt developers will create more examples, documentation, and functionality, paving the way for simple and advanced Android development.