Class PackageManager
Definition
- Namespace:
- Tizen.Applications
- Assembly:
- Tizen.Applications.PackageManager.dll
- API Level:
- 3
PackageManager class. This class has the methods and events of the PackageManager.
C#Copypublic static class PackageManager
- Inheritance
-
PackageManager
Remarks
The package manager is one of the core modules of the Tizen application framework and responsible for getting their information. You can also retrieve information related to the packages that are installed on the device.
Methods
ClearAllCacheDirectory()
Clears all the application's internal and external cache directories.
Declaration
C#Copypublic static void ClearAllCacheDirectory()
Exceptions
Type | Condition |
---|---|
OutOfMemoryException | Thrown when there is not enough memory to continue the execution of the method. |
IOException | Thrown when the method fails due to an internal IO error. |
UnauthorizedAccessException | Thrown when an application does not have the privilege to access this method. |
SystemException | Thrown when the method failed due to an internal system error. |
API Level: 3
Privilege Level: platform
Privilege: http://tizen.org/privilege/packagemanager.admin
ClearCacheDirectory(String)
Clears the application's internal and external cache directories.
Declaration
C#Copypublic static void ClearCacheDirectory(string packageId)
Parameters
Type | Name | Description |
---|---|---|
String | packageId | ID of the package. |
Exceptions
Type | Condition |
---|---|
OutOfMemoryException | Thrown when there is not enough memory to continue the execution of the method. |
IOException | Thrown when the method fails due to an internal I/O error. |
UnauthorizedAccessException | Thrown when an application does not have the privilege to access this method. |
SystemException | Thrown when the method failed due to an internal system error. |
API Level: 3
Privilege Level: public
Privilege: http://tizen.org/privilege/packagemanager.clearcache
ClearDataDirectory(String)
Clears the application's internal and external data directories.
Declaration
C#Copypublic static void ClearDataDirectory(string packageId)
Parameters
Type | Name | Description |
---|---|---|
String | packageId | ID of the package. |
Remarks
All files under data, shared/data, and shared/trusted in the internal storage are removed. And, if the external storage exists, then all files under data and shared/trusted in the external storage are removed.
Exceptions
Type | Condition |
---|---|
OutOfMemoryException | Thrown when there is not enough memory to continue the execution of the method. |
IOException | Thrown when the method failed due to an internal IO error. |
UnauthorizedAccessException | Thrown when an application does not have the privilege to access this method. |
SystemException | Thrown when the method failed due to an internal system error. |
API Level: 3
Privilege Level: platform
Privilege: http://tizen.org/privilege/packagemanager.admin
Declaration
C#Copypublic static CertCompareResultType CompareCertInfo(string lhsPackageId, string rhsPackageId)
Parameters
Type | Name | Description |
---|---|---|
String | lhsPackageId | Package ID to compare. |
String | rhsPackageId | Package ID to be compared. |
Returns
Type | Description |
---|---|
CertCompareResultType | Returns certificate comparison result. |
Exceptions
Type | Condition |
---|---|
ArgumentException | Thrown when the failed input package ID is invalid. |
IOException | Thrown when the method failed due to an internal I/O error. |
API Level: 3
CompareCertInfoByApplicationId(String, String)
Compares the certificate of the two packages which contain each given application ID.
Declaration
C#Copypublic static CertCompareResultType CompareCertInfoByApplicationId(string lhsApplicationId, string rhsApplicationId)
Parameters
Type | Name | Description |
---|---|---|
String | lhsApplicationId | Application ID to compare. |
String | rhsApplicationId | Application ID to be compared. |
Returns
Type | Description |
---|---|
CertCompareResultType | Returns certificate comparison result. |
Exceptions
Type | Condition |
---|---|
ArgumentException | Thrown when the failed input package ID is invalid. |
IOException | Thrown when the method failed due to an internal I/O error. |
API Level: 3
Declaration
C#Copypublic static Package GetPackage(string packageId)
Parameters
Type | Name | Description |
---|---|---|
String | packageId | The ID of the package. |
Returns
Type | Description |
---|---|
Package | Returns the package information for the given package ID. |
Exceptions
Type | Condition |
---|---|
ArgumentException | Thrown when the failed input package ID is invalid. |
OutOfMemoryException | Thrown when there is not enough memory to continue the execution of the method. |
IOException | Thrown when the method fails due to an internal I/O error. |
UnauthorizedAccessException | Thrown when an application does not have the privilege to access this method. |
API Level: 3
Privilege Level: public
Privilege: http://tizen.org/privilege/packagemanager.info
GetPackageArchive(String)
Gets the package archive's information for the given archive path.
Declaration
C#Copypublic static PackageArchive GetPackageArchive(string archivePath)
Parameters
Type | Name | Description |
---|---|---|
String | archivePath | The path of the package archive. |
Returns
Type | Description |
---|---|
PackageArchive | Returns the package archive information for the given archive path. |
Remarks
Regular 3rd party apps do not need to use this API
Exceptions
Type | Condition |
---|---|
ArgumentException | Thrown when the failed input package ID is invalid. |
IOException | Thrown when the method fails due to an internal I/O error. |
API Level: 6
Declaration
C#Copypublic static string GetPackageIdByApplicationId(string applicationId)
Parameters
Type | Name | Description |
---|---|---|
String | applicationId | The ID of the application. |
Returns
Type | Description |
---|---|
String | Returns the ID of the package. |
Remarks
It returns null if the input is null.
Exceptions
Type | Condition |
---|---|
ArgumentException | Thrown when input application ID does not exist. |
OutOfMemoryException | Thrown when there is not enough memory to continue the execution of the method. |
UnauthorizedAccessException | Thrown when an application does not have the privilege to access this method. |
API Level: 3
Privilege Level: public
Privilege: http://tizen.org/privilege/packagemanager.info
Declaration
C#Copypublic static IEnumerable<Package> GetPackages()
Returns
Type | Description |
---|---|
IEnumerable<Package> | Returns the list of packages. |
API Level: 3
Privilege Level: public
Privilege: http://tizen.org/privilege/packagemanager.info
GetPackages(PackageFilter)
Retrieves the package information of all the installed packages satisfying the filter conditions.
Declaration
C#Copypublic static IEnumerable<Package> GetPackages(PackageFilter filter)
Parameters
Type | Name | Description |
---|---|---|
PackageFilter | filter | Optional - package filters. |
Returns
Type | Description |
---|---|
IEnumerable<Package> | Returns the list of packages. |
API Level: 3
Privilege Level: public
Privilege: http://tizen.org/privilege/packagemanager.info
GetPermissionTypeByApplicationId(String)
Gets the permission type of the package which has a given application ID.
Declaration
C#Copypublic static PermissionType GetPermissionTypeByApplicationId(string applicationId)
Parameters
Type | Name | Description |
---|---|---|
String | applicationId | ID of the application. |
Returns
Type | Description |
---|---|
PermissionType | Returns the permission type. |
Exceptions
Type | Condition |
---|---|
ArgumentException | Thrown when the failed input package ID is invalid. |
UnauthorizedAccessException | Thrown when an application does not have the privilege to access this method. |
API Level: 3
Privilege Level: public
Privilege: http://tizen.org/privilege/packagemanager.info
Declaration
C#Copypublic static Task<PackageSizeInformation> GetTotalSizeInformationAsync()
Returns
Type | Description |
---|---|
Task<PackageSizeInformation> | Returns the total package size information asynchronously. |
API Level: 3
Privilege Level: public
Privilege: http://tizen.org/privilege/packagemanager.info
Install(List<String>, InstallationMode)
Installs the packages located at the given path.
Declaration
C#Copypublic static bool Install(List<string> packagePaths, InstallationMode installMode = InstallationMode.Normal)
Parameters
Type | Name | Description |
---|---|---|
List<String> | packagePaths | Absolute paths for the package to be installed. |
InstallationMode | installMode | Optional parameter to indicate special installation mode. |
Returns
Type | Description |
---|---|
Boolean | Returns true if installation request is successful, false otherwise. |
Remarks
The 'true' means that the request for installation is successful. To check the result of installation, the caller should check the progress using the InstallProgressChanged event or eventCallback.
API Level: 8
Privilege Level: platform
Privilege: http://tizen.org/privilege/packagemanager.admin
Install(List<String>, PackageManager.RequestEventCallback, InstallationMode)
Installs the packages located at the given path.
Declaration
C#Copypublic static bool Install(List<string> packagePaths, PackageManager.RequestEventCallback eventCallback, InstallationMode installMode = InstallationMode.Normal)
Parameters
Type | Name | Description |
---|---|---|
List<String> | packagePaths | Absolute paths for the package to be installed. |
PackageManager.RequestEventCallback | eventCallback | The event callback will be invoked only for the current request. |
InstallationMode | installMode | Optional parameter to indicate special installation mode. |
Returns
Type | Description |
---|---|
Boolean | Returns true if installation request is successful, false otherwise. |
Remarks
The 'true' means that the request for installation is successful. To check the result of installation, the caller should check the progress using the InstallProgressChanged event or eventCallback.
API Level: 8
Privilege Level: platform
Privilege: http://tizen.org/privilege/packagemanager.admin
Install(String, String, InstallationMode)
Installs the package located at the given path.
Declaration
C#Copypublic static bool Install(string packagePath, string expansionPackagePath, InstallationMode installMode = InstallationMode.Normal)
Parameters
Type | Name | Description |
---|---|---|
String | packagePath | Absolute path for the package to be installed. |
String | expansionPackagePath | Absolute path for the expansion package to be installed. |
InstallationMode | installMode | Optional parameter to indicate special installation mode. |
Returns
Type | Description |
---|---|
Boolean | Returns true if installation request is successful, false otherwise. |
Remarks
The 'true' means that the request for installation is successful. To check the result of installation, the caller should check the progress using the InstallProgressChanged event.
API Level: 3
Privilege Level: platform
Privilege: http://tizen.org/privilege/packagemanager.admin
Install(String, String, PackageManager.RequestEventCallback, InstallationMode)
Installs the package located at the given path.
Declaration
C#Copypublic static bool Install(string packagePath, string expansionPackagePath, PackageManager.RequestEventCallback eventCallback, InstallationMode installMode = InstallationMode.Normal)
Parameters
Type | Name | Description |
---|---|---|
String | packagePath | Absolute path for the package to be installed. |
String | expansionPackagePath | Absolute path for the expansion package to be installed. |
PackageManager.RequestEventCallback | eventCallback | The event callback will be invoked only for the current request. |
InstallationMode | installMode | Optional parameter to indicate special installation mode. |
Returns
Type | Description |
---|---|
Boolean | Returns true if installation request is successful, false otherwise. |
Remarks
The 'true' means that the request for installation is successful. To check the result of installation, the caller should check the progress using the InstallProgressChanged event or eventCallback.
API Level: 3
Privilege Level: platform
Privilege: http://tizen.org/privilege/packagemanager.admin
Install(String, String, PackageType, InstallationMode)
Installs the package located at the given path.
Declaration
C#Copypublic static bool Install(string packagePath, string expansionPackagePath, PackageType type, InstallationMode installMode = InstallationMode.Normal)
Parameters
Type | Name | Description |
---|---|---|
String | packagePath | Absolute path for the package to be installed. |
String | expansionPackagePath | Absolute path for the expansion package to be installed. |
PackageType | type | Package type for the package to be installed. |
InstallationMode | installMode | Optional parameter to indicate special installation mode. |
Returns
Type | Description |
---|---|
Boolean | Returns true if installation request is successful, false otherwise. |
Remarks
The 'true' means that the request for installation is successful. To check the result of installation, the caller should check the progress using the InstallProgressChanged event.
API Level: 3
Privilege Level: platform
Privilege: http://tizen.org/privilege/packagemanager.admin
Install(String, String, PackageType, PackageManager.RequestEventCallback, InstallationMode)
Installs the package located at the given path.
Declaration
C#Copypublic static bool Install(string packagePath, string expansionPackagePath, PackageType type, PackageManager.RequestEventCallback eventCallback, InstallationMode installMode = InstallationMode.Normal)
Parameters
Type | Name | Description |
---|---|---|
String | packagePath | Absolute path for the package to be installed. |
String | expansionPackagePath | Absolute path for the expansion package to be installed. |
PackageType | type | Package type for the package to be installed. |
PackageManager.RequestEventCallback | eventCallback | The event callback will be invoked only for the current request. |
InstallationMode | installMode | Optional parameter to indicate special installation mode. |
Returns
Type | Description |
---|---|
Boolean | Returns true if installation request is successful, false otherwise. |
Remarks
The 'true' means that the request for installation is successful. To check the result of installation, the caller should check the progress using the InstallProgressChanged event or eventCallback.
API Level: 3
Privilege Level: platform
Privilege: http://tizen.org/privilege/packagemanager.admin
Declaration
C#Copypublic static bool Install(string packagePath, InstallationMode installMode = InstallationMode.Normal)
Parameters
Type | Name | Description |
---|---|---|
String | packagePath | Absolute path for the package to be installed. |
InstallationMode | installMode | Optional parameter to indicate special installation mode. |
Returns
Type | Description |
---|---|
Boolean | Returns true if the installation request is successful, otherwise false. |
Remarks
The 'true' means that the request for installation is successful. To check the result of the installation, the caller should check the progress using the InstallProgressChanged event.
API Level: 3
Privilege Level: platform
Privilege: http://tizen.org/privilege/packagemanager.admin
Install(String, PackageManager.RequestEventCallback, InstallationMode)
Installs the package located at the given path.
Declaration
C#Copypublic static bool Install(string packagePath, PackageManager.RequestEventCallback eventCallback, InstallationMode installMode = InstallationMode.Normal)
Parameters
Type | Name | Description |
---|---|---|
String | packagePath | Absolute path for the package to be installed. |
PackageManager.RequestEventCallback | eventCallback | The event callback will be invoked only for the current request. |
InstallationMode | installMode | Optional parameter to indicate special installation mode. |
Returns
Type | Description |
---|---|
Boolean | Returns true if installation request is successful, false otherwise. |
Remarks
The 'true' means that the request for installation is successful. To check the result of installation, the caller should check the progress using the InstallProgressChanged event or eventCallback.
API Level: 3
Privilege Level: platform
Privilege: http://tizen.org/privilege/packagemanager.admin
Install(String, PackageType, InstallationMode)
Installs the package located at the given path.
Declaration
C#Copypublic static bool Install(string packagePath, PackageType type, InstallationMode installMode = InstallationMode.Normal)
Parameters
Type | Name | Description |
---|---|---|
String | packagePath | Absolute path for the package to be installed. |
PackageType | type | Package type for the package to be installed. |
InstallationMode | installMode | Optional parameter to indicate special installation mode. |
Returns
Type | Description |
---|---|
Boolean | Returns true if installation request is successful, false otherwise. |
Remarks
The 'true' means that the request for installation is successful. To check the result of installation, the caller should check the progress using the InstallProgressChanged event.
API Level: 3
Privilege Level: platform
Privilege: http://tizen.org/privilege/packagemanager.admin
Install(String, PackageType, PackageManager.RequestEventCallback, InstallationMode)
Installs the package located at the given path.
Declaration
C#Copypublic static bool Install(string packagePath, PackageType type, PackageManager.RequestEventCallback eventCallback, InstallationMode installMode = InstallationMode.Normal)
Parameters
Type | Name | Description |
---|---|---|
String | packagePath | Absolute path for the package to be installed. |
PackageType | type | Package type for the package to be installed. |
PackageManager.RequestEventCallback | eventCallback | The event callback will be invoked only for the current request. |
InstallationMode | installMode | Optional parameter to indicate special installation mode. |
Returns
Type | Description |
---|---|
Boolean | Returns true if installation request is successful, false otherwise. |
Remarks
The 'true' means that the request for installation is successful. To check the result of installation, the caller should check the progress using the InstallProgressChanged event or eventCallback.
API Level: 3
Privilege Level: platform
Privilege: http://tizen.org/privilege/packagemanager.admin
IsPreloadPackageByApplicationId(String)
Gets the package's preload attribute which contains a given application ID.
Declaration
C#Copypublic static bool IsPreloadPackageByApplicationId(string applicationId)
Parameters
Type | Name | Description |
---|---|---|
String | applicationId | ID of the application. |
Returns
Type | Description |
---|---|
Boolean | Returns true if the package is preloaded, otherwise false. |
Exceptions
Type | Condition |
---|---|
ArgumentException | Thrown when the failed input package ID is invalid. |
UnauthorizedAccessException | Thrown when an application does not have the privilege to access this method. |
API Level: 3
Privilege Level: public
Privilege: http://tizen.org/privilege/packagemanager.info
Declaration
C#Copypublic static bool Move(string packageId, PackageType type, StorageType newStorage)
Parameters
Type | Name | Description |
---|---|---|
String | packageId | ID of the package to be moved. |
PackageType | type | Optional - Package type for the package to be moved. |
StorageType | newStorage | Storage package should be moved to. |
Returns
Type | Description |
---|---|
Boolean | Returns true if the move request is successful, false otherwise. |
Remarks
The 'true' means that the request for move is successful. To check the result of move, the caller should check the progress using the MoveProgressChanged event.
API Level: 3
Privilege Level: platform
Privilege: http://tizen.org/privilege/packagemanager.admin
Move(String, PackageType, StorageType, PackageManager.RequestEventCallback)
Moves the package to the given storage.
Declaration
C#Copypublic static bool Move(string packageId, PackageType type, StorageType newStorage, PackageManager.RequestEventCallback eventCallback)
Parameters
Type | Name | Description |
---|---|---|
String | packageId | ID of the package to be moved. |
PackageType | type | Optional - Package type for the package to be moved. |
StorageType | newStorage | Storage, package should be moved to. |
PackageManager.RequestEventCallback | eventCallback | Optional - The event callback will be invoked only for the current request. |
Returns
Type | Description |
---|---|
Boolean | Returns true if move request is successful, false otherwise. |
Remarks
The 'true' means that the request for move is successful. To check the result of move, the caller should check the progress using the MoveProgressChanged event.
API Level: 3
Privilege Level: platform
Privilege: http://tizen.org/privilege/packagemanager.admin
Declaration
C#Copypublic static bool Move(string packageId, StorageType newStorage)
Parameters
Type | Name | Description |
---|---|---|
String | packageId | ID of the package to be moved. |
StorageType | newStorage | Storage package should be moved to. |
Returns
Type | Description |
---|---|
Boolean | Returns true if the move request is successful, false otherwise. |
Remarks
The 'true' means that the request for move is successful. To check the result of move, the caller should check the progress using the MoveProgressChanged event.
API Level: 3
Privilege Level: platform
Privilege: http://tizen.org/privilege/packagemanager.admin
Move(String, StorageType, PackageManager.RequestEventCallback)
Moves the package to the given storage.
Declaration
C#Copypublic static bool Move(string packageId, StorageType newStorage, PackageManager.RequestEventCallback eventCallback)
Parameters
Type | Name | Description |
---|---|---|
String | packageId | ID of the package to be moved. |
StorageType | newStorage | Storage package should be moved to. |
PackageManager.RequestEventCallback | eventCallback | Optional - The event callback will be invoked only for the current request. |
Returns
Type | Description |
---|---|
Boolean | Returns true if move request is successful, false otherwise. |
Remarks
The 'true' means that the request for move is successful. To check the result of move, the caller should check the progress using the MoveProgressChanged event.
API Level: 3
Privilege Level: platform
Privilege: http://tizen.org/privilege/packagemanager.admin
Declaration
C#Copypublic static bool Uninstall(string packageId)
Parameters
Type | Name | Description |
---|---|---|
String | packageId | ID of the package to be uninstalled. |
Returns
Type | Description |
---|---|
Boolean | Returns true if the uninstallation request is successful, false otherwise. |
Remarks
The 'true' means that the request for uninstallation is successful. To check the result of uninstallation, the caller should check the progress using the UninstallProgressChanged event.
API Level: 3
Privilege Level: platform
Privilege: http://tizen.org/privilege/packagemanager.admin
Uninstall(String, PackageManager.RequestEventCallback)
Uninstalls the package with the given name.
Declaration
C#Copypublic static bool Uninstall(string packageId, PackageManager.RequestEventCallback eventCallback)
Parameters
Type | Name | Description |
---|---|---|
String | packageId | ID of the package to be uninstalled. |
PackageManager.RequestEventCallback | eventCallback | Optional - The event callback will be invoked only for the current request. |
Returns
Type | Description |
---|---|
Boolean | Returns true if the uninstallation request is successful, false otherwise. |
Remarks
The 'true' means that the request for uninstallation is successful. To check the result of uninstallation, the caller should check the progress using the UninstallProgressChanged event or eventCallback.
API Level: 3
Privilege Level: platform
Privilege: http://tizen.org/privilege/packagemanager.admin
Declaration
C#Copypublic static bool Uninstall(string packageId, PackageType type)
Parameters
Type | Name | Description |
---|---|---|
String | packageId | ID of the package to be uninstalled. |
PackageType | type | Optional - Package type for the package to be uninstalled. |
Returns
Type | Description |
---|---|
Boolean | Returns true if the uninstallation request is successful, false otherwise. |
Remarks
The 'true' means that the request for uninstallation is successful. To check the result of uninstallation, the caller should check the progress using the UninstallProgressChanged event.
API Level: 3
Privilege Level: platform
Privilege: http://tizen.org/privilege/packagemanager.admin
Uninstall(String, PackageType, PackageManager.RequestEventCallback)
Uninstalls the package with the given name.
Declaration
C#Copypublic static bool Uninstall(string packageId, PackageType type, PackageManager.RequestEventCallback eventCallback)
Parameters
Type | Name | Description |
---|---|---|
String | packageId | ID of the package to be uninstalled |
PackageType | type | Optional - Package type for the package to be uninstalled. |
PackageManager.RequestEventCallback | eventCallback | Optional - The event callback will be invoked only for the current request. |
Returns
Type | Description |
---|---|
Boolean | Returns true if the uninstallation request is successful, false otherwise. |
Remarks
The 'true' means that the request for uninstallation is successful. To check the result of uninstallation, the caller should check the progress using the UninstallProgressChanged event or eventCallback.
API Level: 3
Privilege Level: platform
Privilege: http://tizen.org/privilege/packagemanager.admin
Events
ClearDataProgressChanged
ClearDataProgressChanged event. This event occurs when data directories are cleared in the given package.
Declaration
C#Copypublic static event EventHandler<PackageManagerEventArgs> ClearDataProgressChanged
Event Type
Type | Description |
---|---|
EventHandler<PackageManagerEventArgs> |
API Level: 3
InstallProgressChanged
InstallProgressChanged event. This event occurs when a package is getting installed and the progress of the request to the package manager is changed.
Declaration
C#Copypublic static event EventHandler<PackageManagerEventArgs> InstallProgressChanged
Event Type
Type | Description |
---|---|
EventHandler<PackageManagerEventArgs> |
API Level: 3
MoveProgressChanged
MoveProgressChanged event. This event occurs when a package is getting moved and the progress of the request to the package manager is changed.
Declaration
C#Copypublic static event EventHandler<PackageManagerEventArgs> MoveProgressChanged
Event Type
Type | Description |
---|---|
EventHandler<PackageManagerEventArgs> |
API Level: 3
UninstallProgressChanged
UninstallProgressChanged event. This event occurs when a package is getting uninstalled and the progress of the request to the package manager is changed.
Declaration
C#Copypublic static event EventHandler<PackageManagerEventArgs> UninstallProgressChanged
Event Type
Type | Description |
---|---|
EventHandler<PackageManagerEventArgs> |
API Level: 3
UpdateProgressChanged
UpdateProgressChanged event. This event occurs when a package is getting updated and the progress of the request to the package manager is changed.
Declaration
C#Copypublic static event EventHandler<PackageManagerEventArgs> UpdateProgressChanged
Event Type
Type | Description |
---|---|
EventHandler<PackageManagerEventArgs> |