PackageManager.GetPackageInfo Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Overloads
GetPackageInfo(String, PackageManager+PackageInfoFlags) | |
GetPackageInfo(String, PackageInfoFlags) |
Retrieve overall information about an application package that is installed on the system. |
GetPackageInfo(VersionedPackage, PackageInfoFlags) |
Retrieve overall information about an application package that is installed on the system. |
GetPackageInfo(VersionedPackage, PackageManager+PackageInfoFlags) |
GetPackageInfo(String, PackageManager+PackageInfoFlags)
[Android.Runtime.Register("getPackageInfo", "(Ljava/lang/String;Landroid/content/pm/PackageManager$PackageInfoFlags;)Landroid/content/pm/PackageInfo;", "GetGetPackageInfo_Ljava_lang_String_Landroid_content_pm_PackageManager_PackageInfoFlags_Handler", ApiSince=33)]
public virtual Android.Content.PM.PackageInfo GetPackageInfo (string packageName, Android.Content.PM.PackageManager.PackageInfoFlags flags);
[<Android.Runtime.Register("getPackageInfo", "(Ljava/lang/String;Landroid/content/pm/PackageManager$PackageInfoFlags;)Landroid/content/pm/PackageInfo;", "GetGetPackageInfo_Ljava_lang_String_Landroid_content_pm_PackageManager_PackageInfoFlags_Handler", ApiSince=33)>]
abstract member GetPackageInfo : string * Android.Content.PM.PackageManager.PackageInfoFlags -> Android.Content.PM.PackageInfo
override this.GetPackageInfo : string * Android.Content.PM.PackageManager.PackageInfoFlags -> Android.Content.PM.PackageInfo
Parameters
- packageName
- String
Returns
- Attributes
Applies to
GetPackageInfo(String, PackageInfoFlags)
Retrieve overall information about an application package that is installed on the system.
[Android.Runtime.Register("getPackageInfo", "(Ljava/lang/String;I)Landroid/content/pm/PackageInfo;", "GetGetPackageInfo_Ljava_lang_String_IHandler")]
public abstract Android.Content.PM.PackageInfo? GetPackageInfo (string packageName, Android.Content.PM.PackageInfoFlags flags);
[<Android.Runtime.Register("getPackageInfo", "(Ljava/lang/String;I)Landroid/content/pm/PackageInfo;", "GetGetPackageInfo_Ljava_lang_String_IHandler")>]
abstract member GetPackageInfo : string * Android.Content.PM.PackageInfoFlags -> Android.Content.PM.PackageInfo
Parameters
- packageName
- String
The full name (i.e. com.google.apps.contacts) of the desired package.
- flags
- PackageInfoFlags
Additional option flags to modify the data returned.
Returns
A PackageInfo object containing information about the package. If
flag MATCH_UNINSTALLED_PACKAGES
is set and if the package
is not found in the list of installed applications, the package
information is retrieved from the list of uninstalled
applications (which includes installed applications as well as
applications with data directory i.e. applications which had been
deleted with DELETE_KEEP_DATA
flag set).
- Attributes
Exceptions
Remarks
Retrieve overall information about an application package that is installed on the system.
Use #getPackageInfo(String, PackageInfoFlags)
when long flags are needed.
Java documentation for android.content.pm.PackageManager.getPackageInfo(java.lang.String, int)
.
Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.
Applies to
GetPackageInfo(VersionedPackage, PackageInfoFlags)
Retrieve overall information about an application package that is installed on the system.
[Android.Runtime.Register("getPackageInfo", "(Landroid/content/pm/VersionedPackage;I)Landroid/content/pm/PackageInfo;", "GetGetPackageInfo_Landroid_content_pm_VersionedPackage_IHandler", ApiSince=26)]
public abstract Android.Content.PM.PackageInfo? GetPackageInfo (Android.Content.PM.VersionedPackage versionedPackage, Android.Content.PM.PackageInfoFlags flags);
[<Android.Runtime.Register("getPackageInfo", "(Landroid/content/pm/VersionedPackage;I)Landroid/content/pm/PackageInfo;", "GetGetPackageInfo_Landroid_content_pm_VersionedPackage_IHandler", ApiSince=26)>]
abstract member GetPackageInfo : Android.Content.PM.VersionedPackage * Android.Content.PM.PackageInfoFlags -> Android.Content.PM.PackageInfo
Parameters
- versionedPackage
- VersionedPackage
The versioned package for which to query.
- flags
- PackageInfoFlags
Additional option flags to modify the data returned.
Returns
A PackageInfo object containing information about the package. If
flag MATCH_UNINSTALLED_PACKAGES
is set and if the package
is not found in the list of installed applications, the package
information is retrieved from the list of uninstalled
applications (which includes installed applications as well as
applications with data directory i.e. applications which had been
deleted with DELETE_KEEP_DATA
flag set).
- Attributes
Remarks
Retrieve overall information about an application package that is installed on the system. This method can be used for retrieving information about packages for which multiple versions can be installed at the time. Currently only packages hosting static shared libraries can have multiple installed versions. The method can also be used to get info for a package that has a single version installed by passing #VERSION_CODE_HIGHEST
in the VersionedPackage
constructor.
Use #getPackageInfo(VersionedPackage, PackageInfoFlags)
when long flags are needed.
Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.
Applies to
GetPackageInfo(VersionedPackage, PackageManager+PackageInfoFlags)
[Android.Runtime.Register("getPackageInfo", "(Landroid/content/pm/VersionedPackage;Landroid/content/pm/PackageManager$PackageInfoFlags;)Landroid/content/pm/PackageInfo;", "GetGetPackageInfo_Landroid_content_pm_VersionedPackage_Landroid_content_pm_PackageManager_PackageInfoFlags_Handler", ApiSince=33)]
public virtual Android.Content.PM.PackageInfo GetPackageInfo (Android.Content.PM.VersionedPackage versionedPackage, Android.Content.PM.PackageManager.PackageInfoFlags flags);
[<Android.Runtime.Register("getPackageInfo", "(Landroid/content/pm/VersionedPackage;Landroid/content/pm/PackageManager$PackageInfoFlags;)Landroid/content/pm/PackageInfo;", "GetGetPackageInfo_Landroid_content_pm_VersionedPackage_Landroid_content_pm_PackageManager_PackageInfoFlags_Handler", ApiSince=33)>]
abstract member GetPackageInfo : Android.Content.PM.VersionedPackage * Android.Content.PM.PackageManager.PackageInfoFlags -> Android.Content.PM.PackageInfo
override this.GetPackageInfo : Android.Content.PM.VersionedPackage * Android.Content.PM.PackageManager.PackageInfoFlags -> Android.Content.PM.PackageInfo
Parameters
- versionedPackage
- VersionedPackage
Returns
- Attributes