This API provides functionalities to install or uninstall packages, and retrieve information about installed packages.
It also provides a listener method so that an application can be notified when there is a change on the installed packages. For more information on the Package features, see Package Guide.
Remark : Virtual path cannot be used for the parameter. First, you need to convert any virtual path to a file URI path using the resolve function in the Filesystem API before passing it to the function.
Parameters:
packageFileURI: The location of the package to install
progressCallback: The method to invoke when the installation is in progress or has been completed
errorCallback [optional][nullable]: The method to invoke when an error occurs
Exceptions:
WebAPIException
with error type TypeMismatchError, if any input parameter is not compatible with the expected type for that parameter.
with error type SecurityError, if the application does not have the privilege to call this method.
Code example:
var onInstallation = {
onprogress: function(packageId, percentage) {
console.log("On installation(" + packageId + ") : progress(" + percentage + ")");
},
oncomplete: function(packageId) {
console.log("Installation(" + packageId + ") Complete");
}
}
var onError = function (err) {
console.log("Error occurred on installation : " + err.name);
}
// Let's assume that the "test.wgt" file exists in the downloads directory
tizen.filesystem.resolve("downloads/test.wgt",
function (file) {
console.log("file URI : " + file.toURI());
tizen.package.install(file.toURI(), onInstallation, onError);
},
function (err) {
console.log("Error occurred on resolve : " + err.name);
},
"r");
uninstall
Uninstalls the package with a specified package ID.
If the ID is set to null or not set at all, it returns the package information of the current application. The list of installed packages and their package IDs is obtained using getPackagesInfo().
id [optional][nullable]: A string representing the package ID. If the ID is not provided, the package information of the calling application is returned.
Return value:
PackageInformation The information of a package
Exceptions:
WebAPIException
with error type TypeMismatchError, if an input parameter is not compatible with the expected type for that parameter.
with error type SecurityError, if the application does not have the privilege to call this method.
with error type NotFoundError, if the package with the specified ID is not found.
with error type UnknownError, if the package information cannot be retrieved because of a platform error.
Code example:
var packageInfo = tizen.package.getPackageInfo(null);
console.log("Current Package ID : " + packageInfo.id);
setPackageInfoEventListener
Sets a listener to receive notifications for any changes made to the list of installed packages.
An attribute to store the identifier of a package.
Since: 2.1
readonly DOMString name
An attribute to store the package name.
Since: 2.1
readonly DOMString iconPath
An attribute to store the icon path of a package.
The icon path of the package is the same as the icon path of the relevant application (see the iconPath attribute of the ApplicationInformation interface).
The relevant application is the one with the same packageId as the id of this package.
Since: 2.1
readonly DOMString version
An attribute to store the package version.
Since: 2.1
readonly long totalSize
An attribute to store the total installed size(package + data) of a package.
Since: 2.1
readonly long dataSize
An attribute to store the current data size of a package.
Since: 2.1
readonly Date lastModified
An attribute to store the latest installed or updated time of a package.
Since: 2.1
readonly DOMString author
An attribute to store the author of a package.
Since: 2.1
readonly DOMString description
An attribute to store the package description.
Since: 2.1
readonly ApplicationId[] appIds
An attribute to store the application ID list of a package.
Since: 2.1
2.4. PackageInformationArraySuccessCallback
This interface invokes the success callback with an array of PackageInformation objects as an input parameter when the installed package list is retrieved.
We use cookies to improve your experience on our website and to show you relevant
advertising. Manage you settings for our cookies below.
Essential Cookies
These cookies are essential as they enable you to move around the website. This
category cannot be disabled.
Company
Domain
Samsung Electronics
.samsungdeveloperconference.com
Analytical/Performance Cookies
These cookies collect information about how you use our website. for example which
pages you visit most often. All information these cookies collect is used to improve
how the website works.
Company
Domain
LinkedIn
.linkedin.com
Meta (formerly Facebook)
.samsungdeveloperconference.com
Google Inc.
.samsungdeveloperconference.com
Functionality Cookies
These cookies allow our website to remember choices you make (such as your user name, language or the region your are in) and
tailor the website to provide enhanced features and content for you.
Company
Domain
LinkedIn
.ads.linkedin.com, .linkedin.com
Advertising Cookies
These cookies gather information about your browser habits. They remember that
you've visited our website and share this information with other organizations such
as advertisers.
Company
Domain
LinkedIn
.linkedin.com
Meta (formerly Facebook)
.samsungdeveloperconference.com
Google Inc.
.samsungdeveloperconference.com
Preferences Submitted
You have successfully updated your cookie preferences.