Android Programming Press on the image to return to the main documentation page.

PackageUtils

Written by Fr\u00e9d\u00e9ric Leneuf-Magaud

List of types:

PackageInfo
PackageUtils
PkgActivityInfo
PkgApplicationInfo
PkgConfigPrefInfo
PkgPreferredActivity
PkgReceiverInfo

PackageInfo


Events:

None

Members:


  FirstInstallTime As Long [read only]

  GetActivityInfo (Index As Int) As PkgActivityInfo

  GetApplicationInfo As PkgApplicationInfo

  GetConfigPrefInfo (Index As Int) As PkgConfigPrefInfo

  GetProviderName (Index As Int) As String

  GetReceiverInfo (Index As Int) As PkgReceiverInfo

  GetRequestedFeatureName (Index As Int) As String

  GetServiceName (Index As Int) As String

  GetSignatureArray (Index As Int) As Byte()

  GetSignatureString (Index As Int) As String

  IsProviderEnabled (Index As Int) As Boolean

  IsServiceEnabled (Index As Int) As Boolean

  LastUpdateTime As Long [read only]

  NumberOfActivities As Int [read only]

  NumberOfConfigPreferences As Int [read only]

  NumberOfProviders As Int [read only]

  NumberOfReceivers As Int [read only]

  NumberOfRequestedFeatures As Int [read only]

  NumberOfServices As Int [read only]

  NumberOfSignatures As Int [read only]

  PackageName As String [read only]

  RequestedPermissions() As String [read only]

  VersionCode As Int [read only]

  VersionName As String [read only]

Members description:

FirstInstallTime As Long [read only]
GetActivityInfo (Index As Int) As PkgActivityInfo
GetApplicationInfo As PkgApplicationInfo
GetConfigPrefInfo (Index As Int) As PkgConfigPrefInfo
GetProviderName (Index As Int) As String
GetReceiverInfo (Index As Int) As PkgReceiverInfo
GetRequestedFeatureName (Index As Int) As String
GetServiceName (Index As Int) As String
GetSignatureArray (Index As Int) As Byte()
GetSignatureString (Index As Int) As String
IsProviderEnabled (Index As Int) As Boolean
IsServiceEnabled (Index As Int) As Boolean
LastUpdateTime As Long [read only]
NumberOfActivities As Int [read only]
NumberOfConfigPreferences As Int [read only]
NumberOfProviders As Int [read only]
NumberOfReceivers As Int [read only]
NumberOfRequestedFeatures As Int [read only]
NumberOfServices As Int [read only]
NumberOfSignatures As Int [read only]
PackageName As String [read only]
RequestedPermissions() As String [read only]
VersionCode As Int [read only]
VersionName As String [read only]

PackageUtils


Events:

None

Members:


  CheckSignatures (Pkg1 As String, Pkg2 As String) As Int

  ClearPackagePreferredActivities (PackageName As String)

  COMPONENT_STATE_DEFAULT As Int

  COMPONENT_STATE_DISABLED As Int

  COMPONENT_STATE_ENABLED As Int

  FEATURE_AUDIO_LOW_LATENCY As String

  FEATURE_BLUETOOTH As String

  FEATURE_CAMERA As String

  FEATURE_CAMERA_AUTOFOCUS As String

  FEATURE_CAMERA_FLASH As String

  FEATURE_CAMERA_FRONT As String

  FEATURE_LIVE_WALLPAPER As String

  FEATURE_LOCATION As String

  FEATURE_LOCATION_GPS As String

  FEATURE_LOCATION_NETWORK As String

  FEATURE_MICROPHONE As String

  FEATURE_NFC As String

  FEATURE_SENSOR_ACCELEROMETER As String

  FEATURE_SENSOR_BAROMETER As String

  FEATURE_SENSOR_COMPASS As String

  FEATURE_SENSOR_GYROSCOPE As String

  FEATURE_SENSOR_LIGHT As String

  FEATURE_SENSOR_PROXIMITY As String

  FEATURE_SIP As String

  FEATURE_SIP_VOIP As String

  FEATURE_TELEPHONY As String

  FEATURE_TELEPHONY_CDMA As String

  FEATURE_TELEPHONY_GSM As String

  FEATURE_TOUCHSCREEN As String

  FEATURE_TOUCHSCREEN_MULTITOUCH As String

  FEATURE_TOUCHSCREEN_MULTITOUCH_2_OR_MORE As String

  FEATURE_TOUCHSCREEN_MULTITOUCH_5_OR_MORE As String

  FEATURE_WIFI As String

  GET_ACTIVITIES As Int

  GET_ALL As Int

  GET_ALL_APPLICATION_INFO As Int

  GET_ALL_COMPONENTS As Int

  GET_BASIC_INFO As Int

  GET_CONFIGURATIONS As Int

  GET_PERMISSIONS As Int

  GET_PROVIDERS As Int

  GET_RECEIVERS As Int

  GET_SERVICES As Int

  GET_SHARED_LIBRARY_FILES As Int

  GET_SIGNATURES As Int

  GetActivityIcon (PackageName As String, ActivityName As String) As android.graphics.drawable.Drawable

  GetActivityIcon2 (Intent As android.content.Intent) As android.graphics.drawable.Drawable

  GetApplicationIcon (Package As String) As android.graphics.drawable.Drawable

  GetApplicationInfo (PackageName As String) As PkgApplicationInfo

  GetApplicationLabel (Package As String) As String

  GetComponentEnabled (CompName As String) As Int

  GetDefaultActivityIcon As android.graphics.drawable.Drawable

  GetInstalledPackages (Flags As Int) As List

  GetInstallerPackageName (PackageName As String) As String

  GetIntentCategories (Intent As android.content.Intent) As String()

  GetIntentComponentName (Intent As android.content.Intent) As String

  GetLaunchIntent (Package As String) As IntentWrapper

  GetMyPackageName As String

  GetPackageInfo (PackageName As String, Flags As Int) As PackageInfo

  GetPreferredActivities (PackageName As String) As List

  GetSystemAvailableFeatures As List

  HasPermission (PkgName As String, PermName As String) As Boolean

  HasSystemFeature (Feature As String) As Boolean

  InternalPackageManager As android.content.pm.PackageManager [read only]

  QueryBroadcastReceivers (Intent As android.content.Intent) As List

  QueryIntentActivities (Intent As android.content.Intent) As List

  SetComponentEnabled (CompName As String, NewState As Int, KillApp As Boolean)

  SIGNATURE_MATCH As Int

  SIGNATURE_NO_MATCH As Int

  SIGNATURE_UNKNOWN_PACKAGE As Int

Members description:

CheckSignatures (Pkg1 As String, Pkg2 As String) As Int
Compares the signatures of two packages to determine if the same signature appears in both of them. If they do contain the same signature, then they are allowed special privileges when working with each other.
Returns an integer indicating whether all signatures on the two packages match. The value is >= 0 (SIGNATURE_MATCH) if all signatures match or < 0 if there is not a match (SIGNATURE_NO_MATCH or SIGNATURE_UNKNOWN_PACKAGE).
ClearPackagePreferredActivities (PackageName As String)
Removes all preferred activity mappings from the system whose activities are implemented in the given package name. An application can only clear its own package(s).
COMPONENT_STATE_DEFAULT As Int
COMPONENT_STATE_DISABLED As Int
COMPONENT_STATE_ENABLED As Int
FEATURE_AUDIO_LOW_LATENCY As String
FEATURE_BLUETOOTH As String
FEATURE_CAMERA As String
FEATURE_CAMERA_AUTOFOCUS As String
FEATURE_CAMERA_FLASH As String
FEATURE_CAMERA_FRONT As String
FEATURE_LIVE_WALLPAPER As String
FEATURE_LOCATION As String
FEATURE_LOCATION_GPS As String
FEATURE_LOCATION_NETWORK As String
FEATURE_MICROPHONE As String
FEATURE_NFC As String
FEATURE_SENSOR_ACCELEROMETER As String
FEATURE_SENSOR_BAROMETER As String
FEATURE_SENSOR_COMPASS As String
FEATURE_SENSOR_GYROSCOPE As String
FEATURE_SENSOR_LIGHT As String
FEATURE_SENSOR_PROXIMITY As String
FEATURE_SIP As String
FEATURE_SIP_VOIP As String
FEATURE_TELEPHONY As String
FEATURE_TELEPHONY_CDMA As String
FEATURE_TELEPHONY_GSM As String
FEATURE_TOUCHSCREEN As String
FEATURE_TOUCHSCREEN_MULTITOUCH As String
FEATURE_TOUCHSCREEN_MULTITOUCH_2_OR_MORE As String
FEATURE_TOUCHSCREEN_MULTITOUCH_5_OR_MORE As String
FEATURE_WIFI As String
GET_ACTIVITIES As Int
GET_ALL As Int
GET_ALL_APPLICATION_INFO As Int
GET_CONFIGURATIONS + GET_PERMISSIONS + GET_SHARED_LIBRARY_FILES + GET_SIGNATURES
GET_ALL_COMPONENTS As Int
GET_ACTIVITIES + GET_PROVIDERS + GET_RECEIVERS + GET_SERVICES
GET_BASIC_INFO As Int
GET_CONFIGURATIONS As Int
GET_PERMISSIONS As Int
GET_PROVIDERS As Int
GET_RECEIVERS As Int
GET_SERVICES As Int
GET_SHARED_LIBRARY_FILES As Int
GET_SIGNATURES As Int
GetActivityIcon (PackageName As String, ActivityName As String) As android.graphics.drawable.Drawable
Retrieves the icon associated with the specified activity.
PackageName: The full name (e.g. com.google.apps.contacts) of the application.
ActivityName: The full name of the activity inside the package.
GetActivityIcon2 (Intent As android.content.Intent) As android.graphics.drawable.Drawable
Retrieves the icon associated with the specified intent.
GetApplicationIcon (Package As String) As android.graphics.drawable.Drawable
Retrieves the application icon for the specified package.
GetApplicationInfo (PackageName As String) As PkgApplicationInfo
Retrieves all of the information about a particular application.
GetApplicationLabel (Package As String) As String
Retrieves the application label for the specified package.
GetComponentEnabled (CompName As String) As Int
Returns the enabled setting for the specified package component (activity, receiver, service, provider). This returns the last value set by SetComponentEnabled; in most cases this value will be COMPONENT_STATE_DEFAULT since the value originally specified in the manifest has not been modified.
GetDefaultActivityIcon As android.graphics.drawable.Drawable
Returns the generic icon for an activity that is used when no specific icon is defined.
GetInstalledPackages (Flags As Int) As List
Returns a list containing all packages that are installed on the device. Each item of the list is a PackageInfo object.
Flags: Option flags. Use any combination of the GET_ constants, e.g. Bit.OR(PU.GET_ACTIVITIES, PU.GET_PERMISSIONS).
GetInstallerPackageName (PackageName As String) As String
Retrieves the package name of the application that installed a package. This identifies which market the package came from.
GetIntentCategories (Intent As android.content.Intent) As String()
Returns an array containing the categories of the specified intent.
GetIntentComponentName (Intent As android.content.Intent) As String
Returns the package and class names of the specified intent.
GetLaunchIntent (Package As String) As IntentWrapper
Returns a "good" launch intent for the specified package. This fully-qualified intent can be used to launch the main activity in the package.
GetMyPackageName As String
Returns the package name of this application.
GetPackageInfo (PackageName As String, Flags As Int) As PackageInfo
Retrieves overall information about an application package that is installed on the system.
Flags: Option flags. Use any combination of the GET_ constants, e.g. Bit.OR(PU.GET_ACTIVITIES, PU.GET_PERMISSIONS).
GetPreferredActivities (PackageName As String) As List
Retrieves all preferred activities that are currently registered with the system. Each item of the list is a PkgPreferredActivity object.
PackageName: An optional package in which you would like to limit the list. If null or empty, all activities will be returned; otherwise only those activities in the given package are returned.
GetSystemAvailableFeatures As List
Gets a list of features that are available on the system.
HasPermission (PkgName As String, PermName As String) As Boolean
Checks whether a particular package has been granted a particular permission.
PkgName: The name of the package you are checking against.
PermName: The name of the permission you are checking for.
HasSystemFeature (Feature As String) As Boolean
Checks whether the given feature name is one of the available features as returned by GetSystemAvailableFeatures.
InternalPackageManager As android.content.pm.PackageManager [read only]
QueryBroadcastReceivers (Intent As android.content.Intent) As List
Retrieves all receivers that can handle a broadcast of the given intent. Returns a list ordered from first to last in priority.
QueryIntentActivities (Intent As android.content.Intent) As List
Retrieves all activities that can be performed for the given intent. Returns a list ordered from best to worst match.
SetComponentEnabled (CompName As String, NewState As Int, KillApp As Boolean)
Sets the enabled setting for a package component (activity, receiver, service, provider). This setting will override any enabled state which may have been set by the component in its manifest.
CompName: The component to enable.
NewState: The new enabled state for the component (one of the COMPONENT_STATE_ constants). COMPONENT_STATE_DEFAULT removes the setting, thereby restoring the component state to whatever was set in its manifest (or enabled, by default).
KillApp: Whether the application containing the component has to be killed. Be careful when you set this to False since changing component states can make the containing application's behavior unpredictable.
SIGNATURE_MATCH As Int
SIGNATURE_NO_MATCH As Int
SIGNATURE_UNKNOWN_PACKAGE As Int

PkgActivityInfo


Events:

None

Members:


  CONFIG_FONT_SCALE As Int

  CONFIG_KEYBOARD As Int

  CONFIG_KEYBOARD_HIDDEN As Int

  CONFIG_LOCALE As Int

  CONFIG_MCC As Int

  CONFIG_MNC As Int

  CONFIG_NAVIGATION As Int

  CONFIG_ORIENTATION As Int

  CONFIG_SCREEN_LAYOUT As Int

  CONFIG_TOUCHSCREEN As Int

  CONFIG_UI_MODE As Int

  ConfigChanges As Int [read only]

  FLAG_ALLOW_TASK_REPARENTING As Int

  FLAG_ALWAYS_RETAIN_TASK_STATE As Int

  FLAG_CLEAR_TASK_ON_LAUNCH As Int

  FLAG_EXCLUDE_FROM_RECENTS As Int

  FLAG_FINISH_ON_CLOSE_SYSTEM_DIALOGS As Int

  FLAG_FINISH_ON_TASK_LAUNCH As Int

  FLAG_HARDWARE_ACCELERATED As Int

  FLAG_IMMERSIVE As Int

  FLAG_MULTIPROCESS As Int

  FLAG_NO_HISTORY As Int

  FLAG_STATE_NOT_NEEDED As Int

  Flags As Int [read only]

  IsEnabled As Boolean

  IsExported As Boolean

  LAUNCH_MULTIPLE As Int

  LAUNCH_SINGLE_INSTANCE As Int

  LAUNCH_SINGLE_TASK As Int

  LAUNCH_SINGLE_TOP As Int

  LaunchMode As Int [read only]

  Name As String [read only]

  Permission As String [read only]

  SCREEN_ORIENTATION_BEHIND As Int

  SCREEN_ORIENTATION_FULL_SENSOR As Int

  SCREEN_ORIENTATION_LANDSCAPE As Int

  SCREEN_ORIENTATION_LOCKED As Int

  SCREEN_ORIENTATION_NOSENSOR As Int

  SCREEN_ORIENTATION_PORTRAIT As Int

  SCREEN_ORIENTATION_REVERSE_LANDSCAPE As Int

  SCREEN_ORIENTATION_REVERSE_PORTRAIT As Int

  SCREEN_ORIENTATION_SENSOR As Int

  SCREEN_ORIENTATION_SENSOR_LANDSCAPE As Int

  SCREEN_ORIENTATION_SENSOR_PORTRAIT As Int

  SCREEN_ORIENTATION_UNSPECIFIED As Int

  SCREEN_ORIENTATION_USER As Int

  ScreenOrientation As Int [read only]

  SoftInputMode As Int [read only]

  TargetActivity As String [read only]

  TaskAffinity As String [read only]

  ThemeResource As Int [read only]

Members description:

CONFIG_FONT_SCALE As Int
CONFIG_KEYBOARD As Int
CONFIG_KEYBOARD_HIDDEN As Int
CONFIG_LOCALE As Int
CONFIG_MCC As Int
CONFIG_MNC As Int
CONFIG_NAVIGATION As Int
CONFIG_ORIENTATION As Int
CONFIG_SCREEN_LAYOUT As Int
CONFIG_TOUCHSCREEN As Int
CONFIG_UI_MODE As Int
ConfigChanges As Int [read only]
FLAG_ALLOW_TASK_REPARENTING As Int
FLAG_ALWAYS_RETAIN_TASK_STATE As Int
FLAG_CLEAR_TASK_ON_LAUNCH As Int
FLAG_EXCLUDE_FROM_RECENTS As Int
FLAG_FINISH_ON_CLOSE_SYSTEM_DIALOGS As Int
FLAG_FINISH_ON_TASK_LAUNCH As Int
FLAG_HARDWARE_ACCELERATED As Int
FLAG_IMMERSIVE As Int
FLAG_MULTIPROCESS As Int
FLAG_NO_HISTORY As Int
FLAG_STATE_NOT_NEEDED As Int
Flags As Int [read only]
IsEnabled As Boolean
IsExported As Boolean
LAUNCH_MULTIPLE As Int
LAUNCH_SINGLE_INSTANCE As Int
LAUNCH_SINGLE_TASK As Int
LAUNCH_SINGLE_TOP As Int
LaunchMode As Int [read only]
Name As String [read only]
Permission As String [read only]
SCREEN_ORIENTATION_BEHIND As Int
SCREEN_ORIENTATION_FULL_SENSOR As Int
SCREEN_ORIENTATION_LANDSCAPE As Int
SCREEN_ORIENTATION_LOCKED As Int
SCREEN_ORIENTATION_NOSENSOR As Int
SCREEN_ORIENTATION_PORTRAIT As Int
SCREEN_ORIENTATION_REVERSE_LANDSCAPE As Int
SCREEN_ORIENTATION_REVERSE_PORTRAIT As Int
SCREEN_ORIENTATION_SENSOR As Int
SCREEN_ORIENTATION_SENSOR_LANDSCAPE As Int
SCREEN_ORIENTATION_SENSOR_PORTRAIT As Int
SCREEN_ORIENTATION_UNSPECIFIED As Int
SCREEN_ORIENTATION_USER As Int
ScreenOrientation As Int [read only]
SoftInputMode As Int [read only]
TargetActivity As String [read only]
TaskAffinity As String [read only]
ThemeResource As Int [read only]

PkgApplicationInfo


Events:

None

Members:


  DataDir As String [read only]

  Description As String [read only]

  FLAG_ALLOW_BACKUP As Int

  FLAG_ALLOW_CLEAR_USER_DATA As Int

  FLAG_ALLOW_TASK_REPARENTING As Int

  FLAG_DEBUGGABLE As Int

  FLAG_EXTERNAL_STORAGE As Int

  FLAG_PERSISTENT As Int

  FLAG_RESIZEABLE_FOR_SCREENS As Int

  FLAG_SUPPORTS_LARGE_SCREENS As Int

  FLAG_SUPPORTS_NORMAL_SCREENS As Int

  FLAG_SUPPORTS_SCREEN_DENSITIES As Int

  FLAG_SUPPORTS_SMALL_SCREENS As Int

  FLAG_SYSTEM As Int

  FLAG_TEST_ONLY As Int

  FLAG_UPDATED_SYSTEM_APP As Int

  FLAG_VM_SAFE_MODE As Int

  Flags As Int [read only]

  IsEnabled As Boolean

  NativeLibraryDir As String [read only]

  SharedLibraryFiles() As String [read only]

  SourceDir As String [read only]

  TargetSdkVersion As Int [read only]

  TaskAffinity As String [read only]

Members description:

DataDir As String [read only]
Description As String [read only]
FLAG_ALLOW_BACKUP As Int
FLAG_ALLOW_CLEAR_USER_DATA As Int
FLAG_ALLOW_TASK_REPARENTING As Int
FLAG_DEBUGGABLE As Int
FLAG_EXTERNAL_STORAGE As Int
FLAG_PERSISTENT As Int
FLAG_RESIZEABLE_FOR_SCREENS As Int
FLAG_SUPPORTS_LARGE_SCREENS As Int
FLAG_SUPPORTS_NORMAL_SCREENS As Int
FLAG_SUPPORTS_SCREEN_DENSITIES As Int
FLAG_SUPPORTS_SMALL_SCREENS As Int
FLAG_SYSTEM As Int
FLAG_TEST_ONLY As Int
FLAG_UPDATED_SYSTEM_APP As Int
FLAG_VM_SAFE_MODE As Int
Flags As Int [read only]
IsEnabled As Boolean
NativeLibraryDir As String [read only]
SharedLibraryFiles() As String [read only]
SourceDir As String [read only]
TargetSdkVersion As Int [read only]
TaskAffinity As String [read only]

PkgConfigPrefInfo


Events:

None

Members:


  GL_ES_VERSION_UNDEFINED As Int

  GlEsVersion As String [read only]

  ReqGlEsVersion As Int [read only]

  ReqInputFeatures As Int [read only]

  ReqKeyboardType As Int [read only]

  ReqNavigation As Int [read only]

  ReqTouchScreen As Int [read only]

Members description:

GL_ES_VERSION_UNDEFINED As Int
GlEsVersion As String [read only]
ReqGlEsVersion As Int [read only]
ReqInputFeatures As Int [read only]
ReqKeyboardType As Int [read only]
ReqNavigation As Int [read only]
ReqTouchScreen As Int [read only]

PkgPreferredActivity


Events:

None

Members:


  ClassName As String [read only]

  GetAction (Index As Int) As String

  GetCategory (Index As Int) As String

  GetDataPath (Index As Int) As String

  GetDataScheme (Index As Int) As String

  GetDataType (Index As Int) As String

  NumberOfActions As Int [read only]

  NumberOfCategories As Int [read only]

  NumberOfDataPaths As Int [read only]

  NumberOfDataSchemes As Int [read only]

  NumberOfDataTypes As Int [read only]

  PackageName As String [read only]

  Priority As Int [read only]

  ShortClassName As String [read only]

Members description:

ClassName As String [read only]
GetAction (Index As Int) As String
GetCategory (Index As Int) As String
GetDataPath (Index As Int) As String
GetDataScheme (Index As Int) As String
GetDataType (Index As Int) As String
NumberOfActions As Int [read only]
NumberOfCategories As Int [read only]
NumberOfDataPaths As Int [read only]
NumberOfDataSchemes As Int [read only]
NumberOfDataTypes As Int [read only]
PackageName As String [read only]
Priority As Int [read only]
ShortClassName As String [read only]

PkgReceiverInfo


Events:

None

Members:


  IsEnabled As Boolean

  IsExported As Boolean

  Name As String [read only]

  Permission As String [read only]

  ProcessName As String [read only]

Members description:

IsEnabled As Boolean
IsExported As Boolean
Name As String [read only]
Permission As String [read only]
ProcessName As String [read only]

Top