Skip to content

Most visited

Recently visited

navigation

ApplicationInfo

public class ApplicationInfo
extends PackageItemInfo implements Parcelable

java.lang.Object
   ↳ android.content.pm.PackageItemInfo
     ↳ android.content.pm.ApplicationInfo


Information you can retrieve about a particular application. This corresponds to information collected from the AndroidManifest.xml's <application> tag.

Summary

Nested classes

class ApplicationInfo.DisplayNameComparator

 

Constants

int FLAG_ALLOW_BACKUP

Value for flags: set to false if the application does not wish to permit any OS-driven backups of its data; true otherwise.

int FLAG_ALLOW_CLEAR_USER_DATA

Value for flags: default value for the corresponding ActivityInfo flag.

int FLAG_ALLOW_TASK_REPARENTING

Value for flags: default value for the corresponding ActivityInfo flag.

int FLAG_DEBUGGABLE

Value for flags: set to true if this application would like to allow debugging of its code, even when installed on a non-development system.

int FLAG_EXTERNAL_STORAGE

Value for flags: Set to true if the application is currently installed on external/removable/unprotected storage.

int FLAG_EXTRACT_NATIVE_LIBS

When set installer extracts native libs from .apk files.

int FLAG_FACTORY_TEST

Value for flags: set to true if this application holds the FACTORY_TEST permission and the device is running in factory test mode.

int FLAG_FULL_BACKUP_ONLY

Value for flags: true if the application asks that only full-data streaming backups of its data be performed even though it defines a BackupAgent, which normally indicates that the app will manage its backed-up data via incremental key/value updates.

int FLAG_HARDWARE_ACCELERATED

Value for flags: true when the application's rendering should be hardware accelerated.

int FLAG_HAS_CODE

Value for flags: set to true if this application has code associated with it.

int FLAG_INSTALLED

Value for flags: true if the application is currently installed for the calling user.

int FLAG_IS_DATA_ONLY

Value for flags: true if the application only has its data installed; the application package itself does not currently exist on the device.

int FLAG_IS_GAME

Value for flags: true if the application was declared to be a game, or false if it is a non-game application.

int FLAG_KILL_AFTER_RESTORE

Value for flags: set to false if the application must be kept in memory following a full-system restore operation; true otherwise.

int FLAG_LARGE_HEAP

Value for flags: true when the application has requested a large heap for its processes.

int FLAG_MULTIARCH

Value for flags: true if code from this application will need to be loaded into other applications' processes.

int FLAG_PERSISTENT

Value for flags: set to true if this application is persistent.

int FLAG_RESIZEABLE_FOR_SCREENS

Value for flags: true when the application knows how to adjust its UI for different screen sizes.

int FLAG_RESTORE_ANY_VERSION

Value for flags: Set to true if the application's backup agent claims to be able to handle restore data even "from the future," i.e.

int FLAG_STOPPED

Value for flags: true if this application's package is in the stopped state.

int FLAG_SUPPORTS_LARGE_SCREENS

Value for flags: true when the application's window can be increased in size for larger screens.

int FLAG_SUPPORTS_NORMAL_SCREENS

Value for flags: true when the application's window can be displayed on normal screens.

int FLAG_SUPPORTS_RTL

Value for flags: true when the application is willing to support RTL (right to left).

int FLAG_SUPPORTS_SCREEN_DENSITIES

Value for flags: true when the application knows how to accomodate different screen densities.

int FLAG_SUPPORTS_SMALL_SCREENS

Value for flags: true when the application's window can be reduced in size for smaller screens.

int FLAG_SUPPORTS_XLARGE_SCREENS

Value for flags: true when the application's window can be increased in size for extra large screens.

int FLAG_SUSPENDED

Value for flags: true if this application's package is in the suspended state.

int FLAG_SYSTEM

Value for flags: if set, this application is installed in the device's system image.

int FLAG_TEST_ONLY

Value for flags: this is set if the application has specified android:testOnly to be true.

int FLAG_UPDATED_SYSTEM_APP

Value for flags: this is set if this application has been installed as an update to a built-in system application.

int FLAG_USES_CLEARTEXT_TRAFFIC

Value for flags: true if the application may use cleartext network traffic (e.g., HTTP rather than HTTPS; WebSockets rather than WebSockets Secure; XMPP, IMAP, STMP without STARTTLS or TLS).

int FLAG_VM_SAFE_MODE

Value for flags: set to true if this application would like to request the VM to operate under the safe mode.

Inherited constants

From interface android.os.Parcelable

Fields

public static final Creator<ApplicationInfo> CREATOR

public String backupAgentName

Class implementing the Application's backup functionality.

public String className

Class implementing the Application object.

public int compatibleWidthLimitDp

The maximum smallest screen width the application is designed for.

public String dataDir

Full path to the default directory assigned to the package for its persistent data.

public int descriptionRes

A style resource identifier (in the package's resources) of the description of an application.

public String deviceProtectedDataDir

Full path to the device-protected directory assigned to the package for its persistent data.

public boolean enabled

When false, indicates that all components within this application are considered disabled, regardless of their individually set enabled status.

public int flags

Flags associated with the application.

public int largestWidthLimitDp

The maximum smallest screen width the application will work on.

public String manageSpaceActivityName

Class implementing the Application's manage space functionality.

public int minSdkVersion

The minimum SDK version this application can run on.

public String nativeLibraryDir

Full path to the directory where native JNI libraries are stored.

public String permission

Optional name of a permission required to be able to access this application's components.

public String processName

The name of the process this application should run in.

public String publicSourceDir

Full path to the publicly available parts of sourceDir, including resources and manifest.

public int requiresSmallestWidthDp

The required smallest screen width the application can run on.

public String[] sharedLibraryFiles

Paths to all shared libraries this application is linked against.

public String sourceDir

Full path to the base APK for this application.

public String[] splitPublicSourceDirs

Full path to the publicly available parts of splitSourceDirs, including resources and manifest.

public String[] splitSourceDirs

Full paths to zero or more split APKs that, when combined with the base APK defined in sourceDir, form a complete application.

public int targetSdkVersion

The minimum SDK version this application targets.

public String taskAffinity

Default task affinity of all activities in this application.

public int theme

A style resource identifier (in the package's resources) of the default visual theme of the application.

public int uiOptions

The default extra UI options for activities in this application.

public int uid

The kernel user-ID that has been assigned to this application; currently this is not a unique ID (multiple applications can have the same uid).

Inherited fields

From class android.content.pm.PackageItemInfo

Public constructors

ApplicationInfo()
ApplicationInfo(ApplicationInfo orig)

Public methods

int describeContents()

Describe the kinds of special objects contained in this Parcelable instance's marshaled representation.

void dump(Printer pw, String prefix)
CharSequence loadDescription(PackageManager pm)

Retrieve the textual description of the application.

String toString()

Returns a string representation of the object.

void writeToParcel(Parcel dest, int parcelableFlags)

Inherited methods

From class android.content.pm.PackageItemInfo
From class java.lang.Object
From interface android.os.Parcelable

Constants

FLAG_ALLOW_BACKUP

Added in API level 8
int FLAG_ALLOW_BACKUP

Value for flags: set to false if the application does not wish to permit any OS-driven backups of its data; true otherwise.

Comes from the android:allowBackup attribute of the <application> tag.

Constant Value: 32768 (0x00008000)

FLAG_ALLOW_CLEAR_USER_DATA

Added in API level 1
int FLAG_ALLOW_CLEAR_USER_DATA

Value for flags: default value for the corresponding ActivityInfo flag. Comes from android:allowClearUserData of the <application> tag.

Constant Value: 64 (0x00000040)

FLAG_ALLOW_TASK_REPARENTING

Added in API level 1
int FLAG_ALLOW_TASK_REPARENTING

Value for flags: default value for the corresponding ActivityInfo flag. Comes from android:allowTaskReparenting of the <application> tag.

Constant Value: 32 (0x00000020)

FLAG_DEBUGGABLE

Added in API level 1
int FLAG_DEBUGGABLE

Value for flags: set to true if this application would like to allow debugging of its code, even when installed on a non-development system. Comes from android:debuggable of the <application> tag.

Constant Value: 2 (0x00000002)

FLAG_EXTERNAL_STORAGE

Added in API level 8
int FLAG_EXTERNAL_STORAGE

Value for flags: Set to true if the application is currently installed on external/removable/unprotected storage. Such applications may not be available if their storage is not currently mounted. When the storage it is on is not available, it will look like the application has been uninstalled (its .apk is no longer available) but its persistent data is not removed.

Constant Value: 262144 (0x00040000)

FLAG_EXTRACT_NATIVE_LIBS

Added in API level 23
int FLAG_EXTRACT_NATIVE_LIBS

When set installer extracts native libs from .apk files.

Constant Value: 268435456 (0x10000000)

FLAG_FACTORY_TEST

Added in API level 1
int FLAG_FACTORY_TEST

Value for flags: set to true if this application holds the FACTORY_TEST permission and the device is running in factory test mode.

Constant Value: 16 (0x00000010)

FLAG_FULL_BACKUP_ONLY

Added in API level 21
int FLAG_FULL_BACKUP_ONLY

Value for flags: true if the application asks that only full-data streaming backups of its data be performed even though it defines a BackupAgent, which normally indicates that the app will manage its backed-up data via incremental key/value updates.

Constant Value: 67108864 (0x04000000)

FLAG_HARDWARE_ACCELERATED

Added in API level 23
int FLAG_HARDWARE_ACCELERATED

Value for flags: true when the application's rendering should be hardware accelerated.

Constant Value: 536870912 (0x20000000)

FLAG_HAS_CODE

Added in API level 1
int FLAG_HAS_CODE

Value for flags: set to true if this application has code associated with it. Comes from android:hasCode of the <application> tag.

Constant Value: 4 (0x00000004)

FLAG_INSTALLED

Added in API level 17
int FLAG_INSTALLED

Value for flags: true if the application is currently installed for the calling user.

Constant Value: 8388608 (0x00800000)

FLAG_IS_DATA_ONLY

Added in API level 17
int FLAG_IS_DATA_ONLY

Value for flags: true if the application only has its data installed; the application package itself does not currently exist on the device.

Constant Value: 16777216 (0x01000000)

FLAG_IS_GAME

Added in API level 21
int FLAG_IS_GAME

Value for flags: true if the application was declared to be a game, or false if it is a non-game application.

Constant Value: 33554432 (0x02000000)

FLAG_KILL_AFTER_RESTORE

Added in API level 8
int FLAG_KILL_AFTER_RESTORE

Value for flags: set to false if the application must be kept in memory following a full-system restore operation; true otherwise. Ordinarily, during a full system restore operation each application is shut down following execution of its agent's onRestore() method. Setting this attribute to false prevents this. Most applications will not need to set this attribute.

If android:allowBackup is set to false or no android:backupAgent is specified, this flag will be ignored.

Comes from the android:killAfterRestore attribute of the <application> tag.

Constant Value: 65536 (0x00010000)

FLAG_LARGE_HEAP

Added in API level 11
int FLAG_LARGE_HEAP

Value for flags: true when the application has requested a large heap for its processes. Corresponds to android:largeHeap.

Constant Value: 1048576 (0x00100000)

FLAG_MULTIARCH

Added in API level 21
int FLAG_MULTIARCH

Value for flags: true if code from this application will need to be loaded into other applications' processes. On devices that support multiple instruction sets, this implies the code might be loaded into a process that's using any of the devices supported instruction sets.

The system might treat such applications specially, for eg., by extracting the application's native libraries for all supported instruction sets or by compiling the application's dex code for all supported instruction sets.

Constant Value: -2147483648 (0x80000000)

FLAG_PERSISTENT

Added in API level 1
int FLAG_PERSISTENT

Value for flags: set to true if this application is persistent. Comes from android:persistent of the <application> tag.

Constant Value: 8 (0x00000008)

FLAG_RESIZEABLE_FOR_SCREENS

Added in API level 4
int FLAG_RESIZEABLE_FOR_SCREENS

Value for flags: true when the application knows how to adjust its UI for different screen sizes. Corresponds to android:resizeable.

Constant Value: 4096 (0x00001000)

FLAG_RESTORE_ANY_VERSION

Added in API level 8
int FLAG_RESTORE_ANY_VERSION

Value for flags: Set to true if the application's backup agent claims to be able to handle restore data even "from the future," i.e. from versions of the application with a versionCode greater than the one currently installed on the device. Use with caution! By default this attribute is false and the Backup Manager will ensure that data from "future" versions of the application are never supplied during a restore operation.

If android:allowBackup is set to false or no android:backupAgent is specified, this flag will be ignored.

Comes from the android:restoreAnyVersion attribute of the <application> tag.

Constant Value: 131072 (0x00020000)

FLAG_STOPPED

Added in API level 12
int FLAG_STOPPED

Value for flags: true if this application's package is in the stopped state.

Constant Value: 2097152 (0x00200000)

FLAG_SUPPORTS_LARGE_SCREENS

Added in API level 4
int FLAG_SUPPORTS_LARGE_SCREENS

Value for flags: true when the application's window can be increased in size for larger screens. Corresponds to android:largeScreens.

Constant Value: 2048 (0x00000800)

FLAG_SUPPORTS_NORMAL_SCREENS

Added in API level 4
int FLAG_SUPPORTS_NORMAL_SCREENS

Value for flags: true when the application's window can be displayed on normal screens. Corresponds to android:normalScreens.

Constant Value: 1024 (0x00000400)

FLAG_SUPPORTS_RTL

Added in API level 17
int FLAG_SUPPORTS_RTL

Value for flags: true when the application is willing to support RTL (right to left). All activities will inherit this value. Set from the supportsRtl attribute in the activity's manifest. Default value is false (no support for RTL).

Constant Value: 4194304 (0x00400000)

FLAG_SUPPORTS_SCREEN_DENSITIES

Added in API level 4
int FLAG_SUPPORTS_SCREEN_DENSITIES

Value for flags: true when the application knows how to accomodate different screen densities. Corresponds to android:anyDensity.

Constant Value: 8192 (0x00002000)

FLAG_SUPPORTS_SMALL_SCREENS

Added in API level 4
int FLAG_SUPPORTS_SMALL_SCREENS

Value for flags: true when the application's window can be reduced in size for smaller screens. Corresponds to android:smallScreens.

Constant Value: 512 (0x00000200)

FLAG_SUPPORTS_XLARGE_SCREENS

Added in API level 11
int FLAG_SUPPORTS_XLARGE_SCREENS

Value for flags: true when the application's window can be increased in size for extra large screens. Corresponds to android:xlargeScreens.

Constant Value: 524288 (0x00080000)

FLAG_SUSPENDED

Added in API level 24
int FLAG_SUSPENDED

Value for flags: true if this application's package is in the suspended state.

Constant Value: 1073741824 (0x40000000)

FLAG_SYSTEM

Added in API level 1
int FLAG_SYSTEM

Value for flags: if set, this application is installed in the device's system image.

Constant Value: 1 (0x00000001)

FLAG_TEST_ONLY

Added in API level 4
int FLAG_TEST_ONLY

Value for flags: this is set if the application has specified android:testOnly to be true.

Constant Value: 256 (0x00000100)

FLAG_UPDATED_SYSTEM_APP

Added in API level 4
int FLAG_UPDATED_SYSTEM_APP

Value for flags: this is set if this application has been installed as an update to a built-in system application.

Constant Value: 128 (0x00000080)

FLAG_USES_CLEARTEXT_TRAFFIC

Added in API level 23
int FLAG_USES_CLEARTEXT_TRAFFIC

Value for flags: true if the application may use cleartext network traffic (e.g., HTTP rather than HTTPS; WebSockets rather than WebSockets Secure; XMPP, IMAP, STMP without STARTTLS or TLS). If false, the app declares that it does not intend to use cleartext network traffic, in which case platform components (e.g., HTTP stacks, DownloadManager, MediaPlayer) will refuse app's requests to use cleartext traffic. Third-party libraries are encouraged to honor this flag as well.

NOTE: WebView does not honor this flag.

This flag is ignored on Android N and above if an Android Network Security Config is present.

This flag comes from android:usesCleartextTraffic of the <application> tag.

Constant Value: 134217728 (0x08000000)

FLAG_VM_SAFE_MODE

Added in API level 8
int FLAG_VM_SAFE_MODE

Value for flags: set to true if this application would like to request the VM to operate under the safe mode. Comes from android:vmSafeMode of the <application> tag.

Constant Value: 16384 (0x00004000)

Fields

CREATOR

Added in API level 1
Creator<ApplicationInfo> CREATOR

backupAgentName

Added in API level 8
String backupAgentName

Class implementing the Application's backup functionality. From the "backupAgent" attribute. This is an optional attribute and will be null if the application does not specify it in its manifest.

If android:allowBackup is set to false, this attribute is ignored.

className

Added in API level 1
String className

Class implementing the Application object. From the "class" attribute.

compatibleWidthLimitDp

Added in API level 13
int compatibleWidthLimitDp

The maximum smallest screen width the application is designed for. If 0, nothing has been specified. Comes from android:compatibleWidthLimitDp attribute of the <supports-screens> tag.

dataDir

Added in API level 1
String dataDir

Full path to the default directory assigned to the package for its persistent data.

descriptionRes

Added in API level 1
int descriptionRes

A style resource identifier (in the package's resources) of the description of an application. From the "description" attribute or, if not set, 0.

deviceProtectedDataDir

Added in API level 24
String deviceProtectedDataDir

Full path to the device-protected directory assigned to the package for its persistent data.

See also:

enabled

Added in API level 1
boolean enabled

When false, indicates that all components within this application are considered disabled, regardless of their individually set enabled status.

largestWidthLimitDp

Added in API level 13
int largestWidthLimitDp

The maximum smallest screen width the application will work on. If 0, nothing has been specified. Comes from android:largestWidthLimitDp attribute of the <supports-screens> tag.

manageSpaceActivityName

Added in API level 1
String manageSpaceActivityName

Class implementing the Application's manage space functionality. From the "manageSpaceActivity" attribute. This is an optional attribute and will be null if applications don't specify it in their manifest

minSdkVersion

Added in API level 24
int minSdkVersion

The minimum SDK version this application can run on. It will not run on earlier versions.

nativeLibraryDir

Added in API level 9
String nativeLibraryDir

Full path to the directory where native JNI libraries are stored.

permission

Added in API level 1
String permission

Optional name of a permission required to be able to access this application's components. From the "permission" attribute.

processName

Added in API level 1
String processName

The name of the process this application should run in. From the "process" attribute or, if not set, the same as packageName.

publicSourceDir

Added in API level 1
String publicSourceDir

Full path to the publicly available parts of sourceDir, including resources and manifest. This may be different from sourceDir if an application is forward locked.

requiresSmallestWidthDp

Added in API level 13
int requiresSmallestWidthDp

The required smallest screen width the application can run on. If 0, nothing has been specified. Comes from android:requiresSmallestWidthDp attribute of the <supports-screens> tag.

sharedLibraryFiles

Added in API level 1
String[] sharedLibraryFiles

Paths to all shared libraries this application is linked against. This field is only set if the PackageManager.GET_SHARED_LIBRARY_FILES flag was used when retrieving the structure.

sourceDir

Added in API level 1
String sourceDir

Full path to the base APK for this application.

splitPublicSourceDirs

Added in API level 21
String[] splitPublicSourceDirs

Full path to the publicly available parts of splitSourceDirs, including resources and manifest. This may be different from splitSourceDirs if an application is forward locked.

splitSourceDirs

Added in API level 21
String[] splitSourceDirs

Full paths to zero or more split APKs that, when combined with the base APK defined in sourceDir, form a complete application.

targetSdkVersion

Added in API level 4
int targetSdkVersion

The minimum SDK version this application targets. It may run on earlier versions, but it knows how to work with any new behavior added at this version. Will be CUR_DEVELOPMENT if this is a development build and the app is targeting that. You should compare that this number is >= the SDK version number at which your behavior was introduced.

taskAffinity

Added in API level 1
String taskAffinity

Default task affinity of all activities in this application. See taskAffinity for more information. This comes from the "taskAffinity" attribute.

theme

Added in API level 1
int theme

A style resource identifier (in the package's resources) of the default visual theme of the application. From the "theme" attribute or, if not set, 0.

uiOptions

Added in API level 14
int uiOptions

The default extra UI options for activities in this application. Set from the uiOptions attribute in the activity's manifest.

uid

Added in API level 1
int uid

The kernel user-ID that has been assigned to this application; currently this is not a unique ID (multiple applications can have the same uid).

Public constructors

ApplicationInfo

Added in API level 1
ApplicationInfo ()

ApplicationInfo

Added in API level 1
ApplicationInfo (ApplicationInfo orig)

Parameters
orig ApplicationInfo

Public methods

describeContents

Added in API level 1
int describeContents ()

Describe the kinds of special objects contained in this Parcelable instance's marshaled representation. For example, if the object will include a file descriptor in the output of writeToParcel(Parcel, int), the return value of this method must include the CONTENTS_FILE_DESCRIPTOR bit.

Returns
int a bitmask indicating the set of special object types marshaled by this Parcelable object instance.

dump

Added in API level 1
void dump (Printer pw, 
                String prefix)

Parameters
pw Printer
prefix String

loadDescription

Added in API level 1
CharSequence loadDescription (PackageManager pm)

Retrieve the textual description of the application. This will call back on the given PackageManager to load the description from the application.

Parameters
pm PackageManager: A PackageManager from which the label can be loaded; usually the PackageManager from which you originally retrieved this item.
Returns
CharSequence Returns a CharSequence containing the application's description. If there is no description, null is returned.

toString

Added in API level 1
String toString ()

Returns a string representation of the object. In general, the toString method returns a string that "textually represents" this object. The result should be a concise but informative representation that is easy for a person to read. It is recommended that all subclasses override this method.

The toString method for class Object returns a string consisting of the name of the class of which the object is an instance, the at-sign character `@', and the unsigned hexadecimal representation of the hash code of the object. In other words, this method returns a string equal to the value of:

 getClass().getName() + '@' + Integer.toHexString(hashCode())
 

Returns
String a string representation of the object.

writeToParcel

Added in API level 1
void writeToParcel (Parcel dest, 
                int parcelableFlags)

Parameters
dest Parcel
parcelableFlags int
This site uses cookies to store your preferences for site-specific language and display options.

Hooray!

This class requires API level or higher

This doc is hidden because your selected API level for the documentation is . You can change the documentation API level with the selector above the left navigation.

For more information about specifying the API level your app requires, read Supporting Different Platform Versions.

Take a one-minute survey?
Help us improve Android tools and documentation.