QtAndroidExtras contains many important APIs to interact with the Android API with the JNI calls. To ensure the proper working of Qt apps on Android, things like permission handling and dealing with intent are very important, as well as permission handling which is needed by many examples/applications. In general, Qt doesn't need to implement everything that is OS-specific, but at least the tools to do that should be from the start. Other platforms, like iOS, allow using platform API with Qt, for Android that's only available through the JNI, thus it's important to have that ready by default whenever needed by the users. Since we're seeing more attention towards Qt for Android, this is not something that we should leave out.
We're not having Android Extras in Qt 6.0 however, in the subsequent releases (6.1, 6.2) we aim to include the fundamental most needed features from QtAndroidExtras into QtBase.
From the discussion and comments below, Qt Android Extras' the following parts can be moved/re-designed in upcoming releases of Qt namely Qt 6.1/6.2 outside of QtAndroidExtras:
- QAndroidJniObject is mandatory and most important, it has many convenient functions to interact with JNI calls.
- QAndroidJniEnvironment This could include a new function registerNatives() to facilitate registering native methods. Uses for this is to register natives, create class instances, use the JNIEnv* to process JNI objects like arrays.
- QAndroidService is a QGuiApplication alternative to run a service loop, while AndroidExtras have more service classes, this is mandatory for all services even when working with remote objects. Other classes to handle services, intents could be kept in extras.
The list below is for items that are still to be decided soon:
- QtAndroid namespace, mainly for handling permissions and activities/intents.
- activity() , androidContext(), sdkVersion() (could have "android" prefix)
- All permission handling functions.
- QAndroidIntent class for calling and receiving intents (exchange data).
Also, since many other modules are now relying on either qtandroidextras or qtbase private jni headers, they should be all updated as soon as we have the intended JNI changes in place. The modules affected: qtsensors, qtmultimedia, qtconnectivity, qtlocation, qtgamepad, qtwebview, qtpurchasing.
|For Gerrit Dashboard: QTBUG-84382|
|293416,7||Make Android JNI stuff public||dev||qt/qtbase||Status: ABANDONED||-1||0|
|302459,29||Android: Enable QDesktopService||dev||qt/qtbase||Status: MERGED||+2||0|
|304280,15||Android: Add information about who launched this activity to intents||dev||qt/qtbase||Status: MERGED||+2||0|
|306597,2||Add Q_OBJECT to QAndroidService||dev||qt/qtandroidextras||Status: MERGED||+2||0|
|348721,18||Remove QtAndroidExtras module and add note about its state in Qt 6||dev||qt/qtandroidextras||Status: MERGED||+2||0|
|348868,6||Move notification example from androidextras to qtbase||dev||qt/qtbase||Status: MERGED||+2||0|
|352965,11||Remove qtandroidextras submodule||dev||qt/qt5||Status: MERGED||+2||0|
|354347,6||Remove qtandroidextras submodule||6.2||qt/qt5||Status: MERGED||+2||0|
|357139,2||Remove qtandroidextras.yaml from platform_configs||6.2||qt/qt5||Status: MERGED||+2||0|
|357145,3||Remove QtAndroidExtras module and add note about its state in Qt 6||6.2||qt/qtandroidextras||Status: MERGED||+2||0|
|357148,2||Remove qtandroidextras.yaml from platform_configs||dev||qt/qt5||Status: MERGED||+2||0|
|360127,9||Add Extras modules porting guide||dev||qt/qtdoc||Status: MERGED||+2||0|
|360621,2||Add Extras modules porting guide||6.2||qt/qtdoc||Status: MERGED||+2||0|
|367179,2||Android: Add information about who launched this activity to intents||6.2||qt/qtbase||Status: MERGED||+2||0|
|370170,2||Android: Enable QDesktopService||6.2||qt/qtbase||Status: MERGED||+2||0|