C

AndroidAppsUtils QML Type

Qt wrapper for Android Android Apps Utils. More...

Import Statement: import QtAndroidAppsUtils .
Since: QtAndroidAppsUtils 1.0

Properties

Methods

Detailed Description

AndroidAppsUtils allows access to Android APIs to work with apps such as starting, uninstalling, and fetching names and icons.

Property Documentation

installedAppsList : AppsListModel

This property holds the model for installed apps on an Android device. The model is based on a QAbstractListModel and manages a list of elements containing the app name, package name and icon that are retrieved from the Android Drawable counterpart.

Below is a snippet for using this model:

ListView {
    id: listView
    clip: true
    flickableDirection: Flickable.VerticalFlick

    model: AndroidAppsUtils.installedAppsModel
    delegate: Rectangle {
        id: delegate
        height: window.height * 0.05
        width: ListView.view.width

        Row {
            Text {
                id: appName
                text: model.appName + " " + model.packageName
            }
        }
    }
}

To use an app's icon in an Image, use the following:

Image {
    id: appIcon
    source: model.AppIconString
}

This property was introduced in QtAndroidAppsUtils 1.0.


Method Documentation

showAppInfo(string packageName)

Shows the info settings view for the app associated with the provided packageName.

    Button {
        id: startButton
        onClicked: AndroidAppsUtils.showAppInfo("org.qtproject.example.name")
}

This method was introduced in QtAndroidAppsUtils 1.0.


startApp(string packageName)

Starts the app associated with the provided packageName.

Button {
    id: startButton
    onClicked: AndroidAppsUtils.startApp("org.qtproject.example.name")
}

This method was introduced in QtAndroidAppsUtils 1.0.


uninstallApp(string packageName)

Requests the uninstall dialog for the app associated with the provided packageName.

    Button {
        id: startButton
        onClicked: AndroidAppsUtils.uninstallApp("org.qtproject.example.name")
}

This method was introduced in QtAndroidAppsUtils 1.0.


Available under certain Qt licenses.
Find out more.