public class

ApplicationInfo

extends PackageItemInfo
implements Parcelable
java.lang.Object
   ↳ android.content.pm.PackageItemInfo
     ↳ android.content.pm.ApplicationInfo

Class Overview

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
Creator<ApplicationInfo> CREATOR
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_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_HAS_CODE Value for flags: set to true if this application has code associated with it.
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_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_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_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 of 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 install as an update to a built-in system application.
[Expand]
Inherited Constants
From interface android.os.Parcelable
Fields
public String className Class implementing the Application object.
public String dataDir Full path to a 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 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 String manageSpaceActivityName Class implementing the Application's manage space functionality.
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 location of the publicly available parts of this package (i.e.
public String[] sharedLibraryFiles Paths to all shared libraries this application is linked against.
public String sourceDir Full path to the location of this package.
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 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).
[Expand]
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's marshalled representation.
void dump(Printer pw, String prefix)
CharSequence loadDescription(PackageManager pm)
Retrieve the textual description of the application.
String toString()
Returns a string containing a concise, human-readable description of this object.
void writeToParcel(Parcel dest, int parcelableFlags)
[Expand]
Inherited Methods
From class android.content.pm.PackageItemInfo
From class java.lang.Object
From interface android.os.Parcelable

Constants

public static final Creator<ApplicationInfo> CREATOR

Since: API Level 1

public static final int FLAG_ALLOW_CLEAR_USER_DATA

Since: API Level 1

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

Constant Value: 64 (0x00000040)

public static final int FLAG_ALLOW_TASK_REPARENTING

Since: API Level 1

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

Constant Value: 32 (0x00000020)

public static final int FLAG_DEBUGGABLE

Since: API Level 1

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)

public static final int FLAG_FACTORY_TEST

Since: API Level 1

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)

public static final int FLAG_HAS_CODE

Since: API Level 1

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)

public static final int FLAG_PERSISTENT

Since: API Level 1

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

Constant Value: 8 (0x00000008)

public static final int FLAG_RESIZEABLE_FOR_SCREENS

Since: API Level 4

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)

public static final int FLAG_SUPPORTS_LARGE_SCREENS

Since: API Level 4

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

Constant Value: 2048 (0x00000800)

public static final int FLAG_SUPPORTS_NORMAL_SCREENS

Since: API Level 4

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

Constant Value: 1024 (0x00000400)

public static final int FLAG_SUPPORTS_SCREEN_DENSITIES

Since: API Level 4

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

Constant Value: 8192 (0x00002000)

public static final int FLAG_SUPPORTS_SMALL_SCREENS

Since: API Level 4

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)

public static final int FLAG_SYSTEM

Since: API Level 1

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

Constant Value: 1 (0x00000001)

public static final int FLAG_TEST_ONLY

Since: API Level 4

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

Constant Value: 256 (0x00000100)

public static final int FLAG_UPDATED_SYSTEM_APP

Since: API Level 4

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

Constant Value: 128 (0x00000080)

Fields

public String className

Since: API Level 1

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

public String dataDir

Since: API Level 1

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

public int descriptionRes

Since: API Level 1

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

public boolean enabled

Since: API Level 1

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

public String manageSpaceActivityName

Since: API Level 1

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

public String permission

Since: API Level 1

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

public String processName

Since: API Level 1

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

public String publicSourceDir

Since: API Level 1

Full path to the location of the publicly available parts of this package (i.e. the resources and manifest). For non-forward-locked apps this will be the same as {@link #sourceDir).

public String[] sharedLibraryFiles

Since: API Level 1

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.

public String sourceDir

Since: API Level 1

Full path to the location of this package.

public int targetSdkVersion

Since: API Level 4

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.

public String taskAffinity

Since: API Level 1

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

public int theme

Since: API Level 1

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.

public int uid

Since: API Level 1

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

public ApplicationInfo ()

Since: API Level 1

public ApplicationInfo (ApplicationInfo orig)

Since: API Level 1

Public Methods

public int describeContents ()

Since: API Level 1

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

Returns
  • a bitmask indicating the set of special object types marshalled by the Parcelable.

public void dump (Printer pw, String prefix)

Since: API Level 1

public CharSequence loadDescription (PackageManager pm)

Since: API Level 1

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

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

public String toString ()

Since: API Level 1

Returns a string containing a concise, human-readable description of this object. Subclasses are encouraged to override this method and provide an implementation that takes into account the object's type and data. The default implementation simply concatenates the class name, the '@' sign and a hexadecimal representation of the object's hashCode(), that is, it is equivalent to the following expression:

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

Returns
  • a printable representation of this object.

public void writeToParcel (Parcel dest, int parcelableFlags)

Since: API Level 1