Show / Hide Table of Contents

    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.

    public static class PackageManager
    Inheritance
    Object
    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

    View Source

    ClearAllCacheDirectory()

    Clears all the application's internal and external cache directories.

    Declaration
    public 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
    View Source

    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.

    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
    View Source

    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
    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
    View Source

    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.

    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
    View Source

    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.

    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
    View Source

    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.

    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
    View Source

    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
    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
    View Source

    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
    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
    View Source

    GetPackages()

    Retrieves the package information of all installed packages.

    Declaration
    public 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
    View Source

    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
    IEnumerable<Package>

    Returns the list of packages.

    API Level: 3
    Privilege Level: public
    Privilege: http://tizen.org/privilege/packagemanager.info
    View Source

    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.

    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
    View Source

    GetTotalSizeInformationAsync()

    Gets the total package size information.

    Declaration
    public 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
    View Source

    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
    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
    View Source

    Install(List<String>, PackageManager.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
    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
    View Source

    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
    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
    View Source

    Install(String, String, PackageManager.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
    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
    View Source

    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
    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
    View Source

    Install(String, String, PackageType, PackageManager.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
    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
    View Source

    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
    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
    View Source

    Install(String, PackageManager.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
    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
    View Source

    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
    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
    View Source

    Install(String, PackageType, PackageManager.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
    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
    View Source

    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
    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
    View Source

    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
    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
    View Source

    Move(String, PackageType, StorageType, PackageManager.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
    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
    View Source

    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
    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
    View Source

    Move(String, StorageType, PackageManager.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
    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
    View Source

    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
    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
    View Source

    Uninstall(String, PackageManager.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
    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
    View Source

    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
    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
    View Source

    Uninstall(String, PackageType, PackageManager.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
    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

    View Source

    ClearDataProgressChanged

    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
    EventHandler<PackageManagerEventArgs>
    API Level: 3
    View Source

    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
    EventHandler<PackageManagerEventArgs>
    API Level: 3
    View Source

    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
    EventHandler<PackageManagerEventArgs>
    API Level: 3
    View Source

    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
    EventHandler<PackageManagerEventArgs>
    API Level: 3
    View Source

    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
    EventHandler<PackageManagerEventArgs>
    API Level: 3
    • View Source
    Back to top Copyright © 2016-2022 Samsung
    Generated by DocFX