C
AndroidAppsUtils QML Type
Qt wrapper for Android Apps Utils. More...
Import Statement: | import QtAndroidAppsUtils |
Since: | QtAndroidAppsUtils 1.0 |
Properties
- installedAppsModel : model
Methods
- bool showAppInfo(string packageName)
- bool startApp(string packageName)
- bool uninstallApp(string packageName)
Detailed Description
AndroidAppsUtils allows access to Android APIs to work with apps such as starting, uninstalling, and fetching names and icons.
Property Documentation
[since QtAndroidAppsUtils 1.0] installedAppsModel : model |
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
Shows the info settings view for the app associated with the provided packageName. Returns true
if the the app Activity is found and stated, false
if not found.
Button { id: startButton onClicked: AndroidAppsUtils.showAppInfo("org.qtproject.example.name") }
This method was introduced in QtAndroidAppsUtils 1.0.
Starts the app associated with the provided packageName. Returns true
if the the app Activity is found and stated, false
if not found.
Button { id: startButton onClicked: AndroidAppsUtils.startApp("org.qtproject.example.name") }
This method was introduced in QtAndroidAppsUtils 1.0.
Requests the uninstall dialog for the app associated with the provided packageName. Returns true
if the the app Activity is found and stated, false
if not found.
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.