C
Qt Android Activity View Module
This module provides a C++ and a QML wrapper for the native ActivityView class. A Qt Quick plugin is provided to enable access using QML.
Android's ActivityView is a handy class for displaying Android's Activity inside another Activity. It provides proper rendering and events handling of the embedded app or activity out of the box. It creates the possibility for embedding one app into another. Such as, displaying a map app and a music player at the same time inside your app.
Using the Module
Using a Qt module requires linking against the module library, either directly or through other dependencies.
Building with CMake
Use the find_package() and target_link_libraries() commands to locate and link the needed module component from the Qt6 package:
find_package(Qt6 COMPONENTS AndroidActivityView) target_link_libraries(mytarget PUBLIC Qt::AndroidActivityView)
C++ API
To include the definitions of the module's classes, use the following directive for C++:
#include <QtAndroidActivityView>
QML API
For the QML types add the following import statement to your .qml file:
import QtAndroidAutomotive.ActivityView
Permissions
The module needs Android permissions to function properly. For more details, see Permissions in Qt Android Activity View Module.
API Reference
Links to the API reference materials:
Examples
Activity View Known issues and limitations
Since ActivityView needs special permissions and also relies on private Android APIs, apps that use it must be signed with a platform key.
Android 10
The Activity resolved by the provided packageName
and className
must have the resizeableActivity attribute set to true
in order to be launched correctly as an embedded activity. Also, if the activity is not owned by the owner of this app, it must allow embedding. This rule also applies to activities launched from within embedded activities. Otherwise, new activities may not behave correctly, e.g. be launched in fullscreen.
Available under certain Qt licenses.
Find out more.