tizen_package_manager 0.1.0
tizen_package_manager: ^0.1.0 copied to clipboard
Tizen package manager APIs. Used to get detailed information on the installed packages on the Tizen device.
tizen_package_manager #
Tizen package manager API. Used for getting installed package info.
Usage #
To use this package, add tizen_package_manager
as a dependency in your pubspec.yaml
file.
dependencies:
tizen_package_manager: ^0.1.0
copied to clipboard
Retrieving specific package info #
To retrieve information of a specific package, use the getPackageInfo
method which returns an instance of PackageInfo
.
var packageId = 'org.tizen.settings';
var packageInfo = await PackageManager.getPackageInfo(packageId);
copied to clipboard
Retrieving all packages' info #
To retrieve information of all packages installed on a Tizen device, use getPackagesInfo
method.
var packageList = await PackageManager.getPackagesInfo();
for (var package in packageList) {
// Handle each package's info.
}
copied to clipboard
Monitoring package events #
You can listen for package events using onInstallProgressChanged
, onUninstallProgressChanged
, and onUpdateProgressChanged
.
_subscription = PackageManager.onInstallProgressChanged.listen((event) {
// A package is being installed.
});
...
_subscription.cancel();
copied to clipboard
Required privileges #
Privileges are required to use the package manager functionality. Add required privileges in tizen-manifest.xml of your application.
<privileges>
<privilege>http://tizen.org/privilege/packagemanager.info</privilege>
<!-- The below is optional for install/uninstall and platform privilge -->
<privilege>http://tizen.org/privilege/packagemanager.admin</privilege>
</privileges>
copied to clipboard