Class PackageManager
Definition
- Namespace:
- Tizen.Applications
- Assembly:
- Tizen.Applications.PackageManager.dll
PackageManager class. This class has the methods and events of the PackageManager.
public static class PackageManager
- Inheritance
-
objectPackageManager
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
View SourceClearAllCacheDirectory()
Clears all the application's internal and external cache directories.
Declaration
public static void ClearAllCacheDirectory()
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.
Exceptions
Type | Condition |
---|---|
System.OutOfMemoryException | Thrown when there is not enough memory to continue the execution of the method. |
System.IO.IOException | Thrown when the method fails due to an internal IO error. |
System.UnauthorizedAccessException | Thrown when an application does not have the privilege to access this method. |
System.SystemException | Thrown when the method failed due to an internal system error. |
ClearCacheDirectory(string)
Clears the application's internal and external cache directories.
Declaration
public static void ClearCacheDirectory(string packageId)
Parameters
Type | Name | Description |
---|---|---|
string | packageId | ID of the package. |
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.
Exceptions
Type | Condition |
---|---|
System.OutOfMemoryException | Thrown when there is not enough memory to continue the execution of the method. |
System.IO.IOException | Thrown when the method fails due to an internal I/O error. |
System.UnauthorizedAccessException | Thrown when an application does not have the privilege to access this method. |
System.SystemException | Thrown when the method failed due to an internal system error. |
ClearDataDirectory(string)
Clears the application's internal and external data directories.
Declaration
public 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 |
---|---|
System.OutOfMemoryException | Thrown when there is not enough memory to continue the execution of the method. |
System.IO.IOException | Thrown when the method failed due to an internal IO error. |
System.UnauthorizedAccessException | Thrown when an application does not have the privilege to access this method. |
System.SystemException | Thrown when the method failed due to an internal system error. |
ClearUserData(string, string)
Removes a file or directory specified with path
from user data internal storage for the application.
Declaration
public static void ClearUserData(string packageId, string path)
Parameters
Type | Name | Description |
---|---|---|
string | packageId | ID of the package. |
string | path | The path of the file or directory in the package user data folder. |
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.
Exceptions
Type | Condition |
---|---|
System.OutOfMemoryException | Thrown when there is not enough memory to continue the execution of the method. |
System.IO.IOException | Thrown when the method failed due to an internal IO error. |
System.UnauthorizedAccessException | Thrown when an application does not have the privilege to access this method. |
System.SystemException | Thrown when the method failed due to an internal system error. |
CompareCertInfo(string, string)
Compares the certificate of the two packages.
Declaration
public 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. |
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.
Exceptions
Type | Condition |
---|---|
System.ArgumentException | Thrown when the failed input package ID is invalid. |
System.IO.IOException | Thrown when the method failed due to an internal I/O error. |
CompareCertInfoByApplicationId(string, string)
Compares the certificate of the two packages which contain each given application ID.
Declaration
public 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. |
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.
Exceptions
Type | Condition |
---|---|
System.ArgumentException | Thrown when the failed input package ID is invalid. |
System.IO.IOException | Thrown when the method failed due to an internal I/O error. |
GetPackage(string)
Gets the package information for the given package.
Declaration
public 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. |
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.
Exceptions
Type | Condition |
---|---|
System.ArgumentException | Thrown when the failed input package ID is invalid. |
System.OutOfMemoryException | Thrown when there is not enough memory to continue the execution of the method. |
System.IO.IOException | Thrown when the method fails due to an internal I/O error. |
System.UnauthorizedAccessException | Thrown when an application does not have the privilege to access this method. |
GetPackageArchive(string)
Gets the package archive's information for the given archive path.
Declaration
public 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 |
---|---|
System.ArgumentException | Thrown when the failed input package ID is invalid. |
System.IO.IOException | Thrown when the method fails due to an internal I/O error. |
GetPackageIdByApplicationId(string)
Gets the package ID for the given application ID.
Declaration
public 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 |
---|---|
System.ArgumentException | Thrown when input application ID does not exist. |
System.OutOfMemoryException | Thrown when there is not enough memory to continue the execution of the method. |
System.UnauthorizedAccessException | Thrown when an application does not have the privilege to access this method. |
GetPackages()
Retrieves the package information of all installed packages.
Declaration
public static IEnumerable<Package> GetPackages()
Returns
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<T><Package> | Returns the list of packages. |
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.
GetPackages(PackageFilter)
Retrieves the package information of all the installed packages satisfying the filter conditions.
Declaration
public static IEnumerable<Package> GetPackages(PackageFilter filter)
Parameters
Type | Name | Description |
---|---|---|
PackageFilter | filter | Optional - package filters. |
Returns
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<T><Package> | Returns the list of packages. |
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.
GetPermissionTypeByApplicationId(string)
Gets the permission type of the package which has a given application ID.
Declaration
public static PermissionType GetPermissionTypeByApplicationId(string applicationId)
Parameters
Type | Name | Description |
---|---|---|
string | applicationId | ID of the application. |
Returns
Type | Description |
---|---|
PermissionType | Returns the permission type. |
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.
Exceptions
Type | Condition |
---|---|
System.ArgumentException | Thrown when the failed input package ID is invalid. |
System.UnauthorizedAccessException | Thrown when an application does not have the privilege to access this method. |
GetTotalSizeInformationAsync()
Gets the total package size information.
Declaration
public static Task<PackageSizeInformation> GetTotalSizeInformationAsync()
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<TResult><PackageSizeInformation> | Returns the total package size information asynchronously. |
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.
Install(List<string>, InstallationMode)
Installs the packages located at the given path.
Declaration
public static bool Install(List<string> packagePaths, InstallationMode installMode = InstallationMode.Normal)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Generic.List<T><string> | packagePaths | Absolute paths for the package to be installed. |
InstallationMode | installMode | Optional parameter to indicate special installation mode. |
Returns
Type | Description |
---|---|
bool | 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.
Install(List<string>, RequestEventCallback, InstallationMode)
Installs the packages located at the given path.
Declaration
public static bool Install(List<string> packagePaths, PackageManager.RequestEventCallback eventCallback, InstallationMode installMode = InstallationMode.Normal)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Generic.List<T><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 |
---|---|
bool | 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.
Install(string, string, InstallationMode)
Installs the package located at the given path.
Declaration
public 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 |
---|---|
bool | 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.
Install(string, string, RequestEventCallback, InstallationMode)
Installs the package located at the given path.
Declaration
public 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 |
---|---|
bool | 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.
Install(string, string, PackageType, InstallationMode)
Installs the package located at the given path.
Declaration
public 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 |
---|---|
bool | 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.
Install(string, string, PackageType, RequestEventCallback, InstallationMode)
Installs the package located at the given path.
Declaration
public 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 |
---|---|
bool | 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.
Install(string, InstallationMode)
Installs the package located at the given path.
Declaration
public 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 |
---|---|
bool | 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.
Install(string, RequestEventCallback, InstallationMode)
Installs the package located at the given path.
Declaration
public 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 |
---|---|
bool | 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.
Install(string, PackageType, InstallationMode)
Installs the package located at the given path.
Declaration
public 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 |
---|---|
bool | 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.
Install(string, PackageType, RequestEventCallback, InstallationMode)
Installs the package located at the given path.
Declaration
public 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 |
---|---|
bool | 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.
IsPreloadPackageByApplicationId(string)
Gets the package's preload attribute which contains a given application ID.
Declaration
public static bool IsPreloadPackageByApplicationId(string applicationId)
Parameters
Type | Name | Description |
---|---|---|
string | applicationId | ID of the application. |
Returns
Type | Description |
---|---|
bool | Returns true if the package is preloaded, otherwise false. |
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.
Exceptions
Type | Condition |
---|---|
System.ArgumentException | Thrown when the failed input package ID is invalid. |
System.UnauthorizedAccessException | Thrown when an application does not have the privilege to access this method. |
Move(string, PackageType, StorageType, RequestEventCallback)
Moves the package to the given storage.
Declaration
public 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 |
---|---|
bool | 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.
Move(string, PackageType, StorageType)
Moves the package to the given storage.
Declaration
public 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 |
---|---|
bool | 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.
Move(string, StorageType, RequestEventCallback)
Moves the package to the given storage.
Declaration
public 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 |
---|---|
bool | 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.
Move(string, StorageType)
Moves the package to the given storage.
Declaration
public 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 |
---|---|
bool | 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.
Uninstall(string, RequestEventCallback)
Uninstalls the package with the given name.
Declaration
public 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 |
---|---|
bool | 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.
Uninstall(string, PackageType, RequestEventCallback)
Uninstalls the package with the given name.
Declaration
public 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 |
---|---|
bool | 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.
Uninstall(string, PackageType)
Uninstalls package with the given names.
Declaration
public 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 |
---|---|
bool | 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.
Uninstall(string)
Uninstalls the package with the given name.
Declaration
public static bool Uninstall(string packageId)
Parameters
Type | Name | Description |
---|---|---|
string | packageId | ID of the package to be uninstalled. |
Returns
Type | Description |
---|---|
bool | 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.
Events
View SourceClearDataProgressChanged
ClearDataProgressChanged event. This event occurs when data directories are cleared in the given package.
Declaration
public static event EventHandler<PackageManagerEventArgs> ClearDataProgressChanged
Event Type
Type | Description |
---|---|
System.EventHandler<TEventArgs><PackageManagerEventArgs> |
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.
Exceptions
Type | Condition |
---|---|
System.IO.IOException | Thrown when subscribing to package manager event failed. |
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
public static event EventHandler<PackageManagerEventArgs> InstallProgressChanged
Event Type
Type | Description |
---|---|
System.EventHandler<TEventArgs><PackageManagerEventArgs> |
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.
Exceptions
Type | Condition |
---|---|
System.IO.IOException | Thrown when subscribing to package manager event failed. |
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
public static event EventHandler<PackageManagerEventArgs> MoveProgressChanged
Event Type
Type | Description |
---|---|
System.EventHandler<TEventArgs><PackageManagerEventArgs> |
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.
Exceptions
Type | Condition |
---|---|
System.IO.IOException | Thrown when subscribing to package manager event failed. |
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
public static event EventHandler<PackageManagerEventArgs> UninstallProgressChanged
Event Type
Type | Description |
---|---|
System.EventHandler<TEventArgs><PackageManagerEventArgs> |
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.
Exceptions
Type | Condition |
---|---|
System.IO.IOException | Thrown when subscribing to package manager event failed. |
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
public static event EventHandler<PackageManagerEventArgs> UpdateProgressChanged
Event Type
Type | Description |
---|---|
System.EventHandler<TEventArgs><PackageManagerEventArgs> |
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.
Exceptions
Type | Condition |
---|---|
System.IO.IOException | Thrown when subscribing to package manager event failed. |