最后
Android学习是一条漫长的道路,我们要学习的东西不仅仅只有表面的 技术,还要深入底层,弄明白下面的 原理,只有这样,我们才能够提高自己的竞争力,在当今这个竞争激烈的世界里立足。
人生不可能一帆风顺,有高峰自然有低谷,要相信,那些打不倒我们的,终将使我们更强大,要做自己的摆渡人。
资源持续更新中,欢迎大家一起学习和探讨。
网上学习资料一大堆,但如果学到的知识不成体系,遇到问题时只是浅尝辄止,不再深入研究,那么很难做到真正的技术提升。
一个人可以走的很快,但一群人才能走的更远!不论你是正从事IT行业的老鸟或是对IT行业感兴趣的新人,都欢迎加入我们的的圈子(技术交流、学习资源、职场吐槽、大厂内推、面试辅导),让我们一起学习成长!
-
public ActivityInfo[] activities;
-
/**
-
* Array of all {@link android.R.styleable#AndroidManifestReceiver
-
* } tags included under ,
-
* or null if there were none. This is only filled in if the flag
-
* {@link PackageManager#GET_RECEIVERS} was set.
-
*/
-
public ActivityInfo[] receivers;
-
/**
-
* Array of all {@link android.R.styleable#AndroidManifestService
-
* } tags included under ,
-
* or null if there were none. This is only filled in if the flag
-
* {@link PackageManager#GET_SERVICES} was set.
-
*/
-
public ServiceInfo[] services;
-
/**
-
* Array of all {@link android.R.styleable#AndroidManifestProvider
-
* } tags included under ,
-
* or null if there were none. This is only filled in if the flag
-
* {@link PackageManager#GET_PROVIDERS} was set.
-
*/
-
public ProviderInfo[] providers;
-
/**
-
* Array of all {@link android.R.styleable#AndroidManifestInstrumentation
-
* } tags included under ,
-
* or null if there were none. This is only filled in if the flag
-
* {@link PackageManager#GET_INSTRUMENTATION} was set.
-
*/
-
public InstrumentationInfo[] instrumentation;
-
/**
-
* Array of all {@link android.R.styleable#AndroidManifestPermission
-
* } tags included under ,
-
* or null if there were none. This is only filled in if the flag
-
* {@link PackageManager#GET_PERMISSIONS} was set.
-
*/
-
public PermissionInfo[] permissions;
-
/**
-
* Array of all {@link android.R.styleable#AndroidManifestUsesPermission
-
* } tags included under ,
-
* or null if there were none. This is only filled in if the flag
-
* {@link PackageManager#GET_PERMISSIONS} was set. This list includes
-
* all permissions requested, even those that were not granted or known
-
* by the system at install time.
-
*/
-
public String[] requestedPermissions;
-
/**
-
* Array of flags of all {@link android.R.styleable#AndroidManifestUsesPermission
-
* } tags included under ,
-
* or null if there were none. This is only filled in if the flag
-
* {@link PackageManager#GET_PERMISSIONS} was set. Each value matches
-
* the corresponding entry in {@link #requestedPermissions}, and will have
-
* the flags {@link #REQUESTED_PERMISSION_REQUIRED} and
-
* {@link #REQUESTED_PERMISSION_GRANTED} set as appropriate.
-
*/
-
public int[] requestedPermissionsFlags;
-
/**
-
* Flag for {@link #requestedPermissionsFlags}: the requested permission
-
* is required for the application to run; the user can not optionally
-
* disable it. Currently all permissions are required.
-
*/
-
public static final int REQUESTED_PERMISSION_REQUIRED = 1<<0;
-
/**
-
* Flag for {@link #requestedPermissionsFlags}: the requested permission
-
* is currently granted to the application.
-
*/
-
public static final int REQUESTED_PERMISSION_GRANTED = 1<<1;
-
/**
-
* Array of all signatures read from the package file. This is only filled
-
* in if the flag {@link PackageManager#GET_SIGNATURES} was set.
-
*/
-
public Signature[] signatures;
-
/**
-
* Application specified preferred configuration
-
* {@link android.R.styleable#AndroidManifestUsesConfiguration
-
* } tags included under ,
-
* or null if there were none. This is only filled in if the flag
-
* {@link PackageManager#GET_CONFIGURATIONS} was set.
-
*/
-
public ConfigurationInfo[] configPreferences;
-
/**
-
* The features that this application has said it requires.
-
*/
-
public FeatureInfo[] reqFeatures;
-
/**
-
* Constant corresponding to
auto
in -
* the {@link android.R.attr#installLocation} attribute.
-
* @hide
-
*/
-
public static final int INSTALL_LOCATION_UNSPECIFIED = -1;
-
/**
-
* Constant corresponding to
auto
in -
* the {@link android.R.attr#installLocation} attribute.
-
* @hide
-
*/
-
public static final int INSTALL_LOCATION_AUTO = 0;
-
/**
-
* Constant corresponding to
internalOnly
in -
* the {@link android.R.attr#installLocation} attribute.
-
* @hide
-
*/
-
public static final int INSTALL_LOCATION_INTERNAL_ONLY = 1;
-
/**
-
* Constant corresponding to
preferExternal
in -
* the {@link android.R.attr#installLocation} attribute.
-
* @hide
-
*/
-
public static final int INSTALL_LOCATION_PREFER_EXTERNAL = 2;
-
/**
-
* The install location requested by the activity. From the
-
* {@link android.R.attr#installLocation} attribute, one of
-
* {@link #INSTALL_LOCATION_AUTO},
-
* {@link #INSTALL_LOCATION_INTERNAL_ONLY},
-
* {@link #INSTALL_LOCATION_PREFER_EXTERNAL}
-
* @hide
-
*/
-
public int installLocation = INSTALL_LOCATION_INTERNAL_ONLY;
-
public PackageInfo() {
-
}
-
public String toString() {
-
return “PackageInfo{”
-
+ Integer.toHexString(System.identityHashCode(this))
-
+ " " + packageName + “}”;
-
}
-
public int describeContents() {
-
return 0;
-
}
-
public void writeToParcel(Parcel dest, int parcelableFlags) {
-
dest.writeString(packageName);
-
dest.writeInt(versionCode);
-
dest.writeString(versionName);
-
dest.writeString(sharedUserId);
-
dest.writeInt(sharedUserLabel);
-
if (applicationInfo != null) {
-
dest.writeInt(1);
-
applicationInfo.writeToParcel(dest, parcelableFlags);
-
} else {
-
dest.writeInt(0);
-
}
-
dest.writeLong(firstInstallTime);
-
dest.writeLong(lastUpdateTime);
-
dest.writeIntArray(gids);
-
dest.writeTypedArray(activities, parcelableFlags);
-
dest.writeTypedArray(receivers, parcelableFlags);
-
dest.writeTypedArray(services, parcelableFlags);
-
dest.writeTypedArray(providers, parcelableFlags);
-
dest.writeTypedArray(instrumentation, parcelableFlags);
-
dest.writeTypedArray(permissions, parcelableFlags);
-
dest.writeStringArray(requestedPermissions);
-
dest.writeIntArray(requestedPermissionsFlags);
-
dest.writeTypedArray(signatures, parcelableFlags);
-
dest.writeTypedArray(configPreferences, parcelableFlags);
-
dest.writeTypedArray(reqFeatures, parcelableFlags);
-
dest.writeInt(installLocation);
-
}
-
public static final Parcelable.Creator CREATOR
-
= new Parcelable.Creator() {
-
public PackageInfo createFromParcel(Parcel source) {
-
return new PackageInfo(source);
-
}
-
public PackageInfo[] newArray(int size) {
-
return new PackageInfo[size];
-
}
-
};
-
private PackageInfo(Parcel source) {
-
<span style=“color:#3333ff;”> packageName = source.readString();
-
versionCode = source.readInt();
-
versionName = source.readString();
-
sharedUserId = source.readString();
-
sharedUserLabel = source.readInt();
-
int hasApp = source.readInt();
-
if (hasApp != 0) {
-
applicationInfo = ApplicationInfo.CREATOR.createFromParcel(source);
-
}
-
<span style=“color:#333399;”>firstInstallTime = source.readLong();
-
lastUpdateTime = source.readLong();
-
gids = source.createIntArray();
-
activities = source.createTypedArray(ActivityInfo.CREATOR);
-
receivers = source.createTypedArray(ActivityInfo.CREATOR);
-
services = source.createTypedArray(ServiceInfo.CREATOR);
-
providers = source.createTypedArray(ProviderInfo.CREATOR);
-
instrumentation = source.createTypedArray(InstrumentationInfo.CREATOR);
-
permissions = source.createTypedArray(PermissionInfo.CREATOR);
-
requestedPermissions = source.createStringArray();
-
requestedPermissionsFlags = source.createIntArray();
-
signatures = source.createTypedArray(Signature.CREATOR);
-
configPreferences = source.createTypedArray(ConfigurationInfo.CREATOR);
-
reqFeatures = source.createTypedArray(FeatureInfo.CREATOR);
-
installLocation = source.readInt();
-
}
-
}
ApplicationInfo.java源码:
[java] view plain copy
-
/*
-
* Copyright © 2007 The Android Open Source Project
-
*
-
* Licensed under the Apache License, Version 2.0 (the “License”);
-
* you may not use this file except in compliance with the License.
-
* You may obtain a copy of the License at
-
*
-
* http://www.apache.org/licenses/LICENSE-2.0
-
*
-
* Unless required by applicable law or agreed to in writing, software
-
* distributed under the License is distributed on an “AS IS” BASIS,
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-
* See the License for the specific language governing permissions and
-
* limitations under the License.
-
*/
-
package android.content.pm;
-
import android.content.pm.PackageManager.NameNotFoundException;
-
import android.content.res.Resources;
-
import android.graphics.drawable.Drawable;
-
import android.os.Parcel;
-
import android.os.Parcelable;
-
import android.util.Printer;
-
import java.text.Collator;
-
import java.util.Comparator;
-
/**
-
* Information you can retrieve about a particular application. This
-
* corresponds to information collected from the AndroidManifest.xml’s
-
* tag.
-
*/
-
public class ApplicationInfo extends PackageItemInfo implements Parcelable {
-
/**
-
* Default task affinity of all activities in this application. See
-
* {@link ActivityInfo#taskAffinity} for more information. This comes
-
* from the “taskAffinity” attribute.
-
*/
-
public String taskAffinity;
-
/**
-
* Optional name of a permission required to be able to access this
-
* application’s components. From the “permission” attribute.
-
*/
-
public String permission;
-
/**
-
* The name of the process this application should run in. From the
-
* “process” attribute or, if not set, the same as
-
* packageName.
-
*/
-
public String processName;
-
/**
-
* Class implementing the Application object. From the “class”
-
* attribute.
-
*/
-
public String className;
-
/**
-
* 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 int descriptionRes;
-
/**
-
* 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 theme;
-
/**
-
* 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 manageSpaceActivityName;
-
/**
-
* 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.
-
*/
-
public String backupAgentName;
-
/**
-
* The default extra UI options for activities in this application.
-
* Set from the {@link android.R.attr#uiOptions} attribute in the
-
* activity’s manifest.
-
*/
-
public int uiOptions = 0;
-
/**
-
* Value for {@link #flags}: if set, this application is installed in the
-
* device’s system image.
-
*/
-
public static final int FLAG_SYSTEM = 1<<0;
-
/**
-
* Value for {@link #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 {@link android.R.styleable#AndroidManifestApplication_debuggable
-
* android:debuggable} of the tag.
-
*/
-
public static final int FLAG_DEBUGGABLE = 1<<1;
-
/**
-
* Value for {@link #flags}: set to true if this application has code
-
* associated with it. Comes
-
* from {@link android.R.styleable#AndroidManifestApplication_hasCode
-
* android:hasCode} of the tag.
-
*/
-
public static final int FLAG_HAS_CODE = 1<<2;
-
/**
-
* Value for {@link #flags}: set to true if this application is persistent.
-
* Comes from {@link android.R.styleable#AndroidManifestApplication_persistent
-
* android:persistent} of the tag.
-
*/
-
public static final int FLAG_PERSISTENT = 1<<3;
-
/**
-
* Value for {@link #flags}: set to true if this application holds the
-
* {@link android.Manifest.permission#FACTORY_TEST} permission and the
-
* device is running in factory test mode.
-
*/
-
public static final int FLAG_FACTORY_TEST = 1<<4;
-
/**
-
* Value for {@link #flags}: default value for the corresponding ActivityInfo flag.
-
* Comes from {@link android.R.styleable#AndroidManifestApplication_allowTaskReparenting
-
* android:allowTaskReparenting} of the tag.
-
*/
-
public static final int FLAG_ALLOW_TASK_REPARENTING = 1<<5;
-
/**
-
* Value for {@link #flags}: default value for the corresponding ActivityInfo flag.
-
* Comes from {@link android.R.styleable#AndroidManifestApplication_allowClearUserData
-
* android:allowClearUserData} of the tag.
-
*/
-
public static final int FLAG_ALLOW_CLEAR_USER_DATA = 1<<6;
-
/**
-
* Value for {@link #flags}: this is set if this application has been
-
* install as an update to a built-in system application.
-
*/
-
public static final int FLAG_UPDATED_SYSTEM_APP = 1<<7;
-
/**
-
* Value for {@link #flags}: this is set of the application has specified
-
* {@link android.R.styleable#AndroidManifestApplication_testOnly
-
* android:testOnly} to be true.
-
*/
-
public static final int FLAG_TEST_ONLY = 1<<8;
-
/**
-
* Value for {@link #flags}: true when the application’s window can be
-
* reduced in size for smaller screens. Corresponds to
-
* {@link android.R.styleable#AndroidManifestSupportsScreens_smallScreens
-
* android:smallScreens}.
-
*/
-
public static final int FLAG_SUPPORTS_SMALL_SCREENS = 1<<9;
-
/**
-
* Value for {@link #flags}: true when the application’s window can be
-
* displayed on normal screens. Corresponds to
-
* {@link android.R.styleable#AndroidManifestSupportsScreens_normalScreens
-
* android:normalScreens}.
-
*/
-
public static final int FLAG_SUPPORTS_NORMAL_SCREENS = 1<<10;
-
/**
-
* Value for {@link #flags}: true when the application’s window can be
-
* increased in size for larger screens. Corresponds to
-
* {@link android.R.styleable#AndroidManifestSupportsScreens_largeScreens
-
* android:largeScreens}.
-
*/
-
public static final int FLAG_SUPPORTS_LARGE_SCREENS = 1<<11;
-
/**
-
* Value for {@link #flags}: true when the application knows how to adjust
-
* its UI for different screen sizes. Corresponds to
-
* {@link android.R.styleable#AndroidManifestSupportsScreens_resizeable
-
* android:resizeable}.
-
*/
-
public static final int FLAG_RESIZEABLE_FOR_SCREENS = 1<<12;
-
/**
-
* Value for {@link #flags}: true when the application knows how to
-
* accomodate different screen densities. Corresponds to
-
* {@link android.R.styleable#AndroidManifestSupportsScreens_anyDensity
-
* android:anyDensity}.
-
*/
-
public static final int FLAG_SUPPORTS_SCREEN_DENSITIES = 1<<13;
-
/**
-
* Value for {@link #flags}: set to true if this application would like to
-
* request the VM to operate under the safe mode. Comes from
-
* {@link android.R.styleable#AndroidManifestApplication_vmSafeMode
-
* android:vmSafeMode} of the tag.
-
*/
-
public static final int FLAG_VM_SAFE_MODE = 1<<14;
-
/**
-
* Value for {@link #flags}: set to
false
if the application does not wish -
* to permit any OS-driven backups of its data;
true
otherwise. -
*
-
*
Comes from the
-
* {@link android.R.styleable#AndroidManifestApplication_allowBackup android:allowBackup}
-
* attribute of the tag.
-
*/
-
public static final int FLAG_ALLOW_BACKUP = 1<<15;
-
/**
-
* Value for {@link #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
-
* {@link android.R.styleable#AndroidManifestApplication_allowBackup android:allowBackup}
-
* is set to
false
or no -
* {@link android.R.styleable#AndroidManifestApplication_backupAgent android:backupAgent}
-
* is specified, this flag will be ignored.
-
*
-
*
Comes from the
-
* {@link android.R.styleable#AndroidManifestApplication_killAfterRestore android:killAfterRestore}
-
* attribute of the tag.
-
*/
-
public static final int FLAG_KILL_AFTER_RESTORE = 1<<16;
-
/**
-
* Value for {@link #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
-
* {@link android.R.styleable#AndroidManifestApplication_allowBackup android:allowBackup}
-
* is set to
false
or no -
* {@link android.R.styleable#AndroidManifestApplication_backupAgent android:backupAgent}
-
* is specified, this flag will be ignored.
-
*
-
*
Comes from the
-
* {@link android.R.styleable#AndroidManifestApplication_restoreAnyVersion android:restoreAnyVersion}
-
* attribute of the tag.
-
*/
-
public static final int FLAG_RESTORE_ANY_VERSION = 1<<17;
-
/**
-
* Value for {@link #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.
-
*/
-
public static final int FLAG_EXTERNAL_STORAGE = 1<<18;
-
/**
-
* Value for {@link #flags}: true when the application’s window can be
-
* increased in size for extra large screens. Corresponds to
-
* {@link android.R.styleable#AndroidManifestSupportsScreens_xlargeScreens
-
* android:xlargeScreens}.
-
*/
-
public static final int FLAG_SUPPORTS_XLARGE_SCREENS = 1<<19;
-
/**
-
* Value for {@link #flags}: true when the application has requested a
-
* large heap for its processes. Corresponds to
-
* {@link android.R.styleable#AndroidManifestApplication_largeHeap
-
* android:largeHeap}.
-
*/
-
public static final int FLAG_LARGE_HEAP = 1<<20;
-
/**
-
* Value for {@link #flags}: true if this application’s package is in
-
* the stopped state.
-
*/
-
public static final int FLAG_STOPPED = 1<<21;
-
/**
-
* Value for {@link #flags}: true when the application is willing to support
-
* RTL (right to left). All activities will inherit this value.
-
*
-
* Set from the {@link android.R.attr#supportsRtl} attribute in the
-
* activity’s manifest.
-
*
-
* Default value is false (no support for RTL).
-
*/
-
public static final int FLAG_SUPPORTS_RTL = 1<<22;
-
/**
-
* Value for {@link #flags}: true if the application is currently
-
* installed for the calling user.
-
*/
-
public static final int FLAG_INSTALLED = 1<<23;
-
/**
-
* Value for {@link #flags}: true if the application only has its
-
* data installed; the application package itself does not currently
-
* exist on the device.
-
*/
-
public static final int FLAG_IS_DATA_ONLY = 1<<24;
-
/**
-
* Value for {@link #flags}: Set to true if the application has been
-
* installed using the forward lock option.
-
*
-
* NOTE: DO NOT CHANGE THIS VALUE! It is saved in packages.xml.
-
*
-
* {@hide}
-
*/
-
public static final int FLAG_FORWARD_LOCK = 1<<29;
-
/**
-
* Value for {@link #flags}: set to
true
if the application -
* has reported that it is heavy-weight, and thus can not participate in
-
* the normal application lifecycle.
-
*
-
*
Comes from the
-
* {@link android.R.styleable#AndroidManifestApplication_cantSaveState android:cantSaveState}
-
* attribute of the tag.
-
*
-
* {@hide}
-
*/
-
public static final int FLAG_CANT_SAVE_STATE = 1<<28;
-
/**
-
* Flags associated with the application. Any combination of
-
* {@link #FLAG_SYSTEM}, {@link #FLAG_DEBUGGABLE}, {@link #FLAG_HAS_CODE},
-
* {@link #FLAG_PERSISTENT}, {@link #FLAG_FACTORY_TEST}, and
-
* {@link #FLAG_ALLOW_TASK_REPARENTING}
-
* {@link #FLAG_ALLOW_CLEAR_USER_DATA}, {@link #FLAG_UPDATED_SYSTEM_APP},
-
* {@link #FLAG_TEST_ONLY}, {@link #FLAG_SUPPORTS_SMALL_SCREENS},
-
* {@link #FLAG_SUPPORTS_NORMAL_SCREENS},
-
* {@link #FLAG_SUPPORTS_LARGE_SCREENS}, {@link #FLAG_SUPPORTS_XLARGE_SCREENS},
-
* {@link #FLAG_RESIZEABLE_FOR_SCREENS},
-
* {@link #FLAG_SUPPORTS_SCREEN_DENSITIES}, {@link #FLAG_VM_SAFE_MODE},
-
* {@link #FLAG_INSTALLED}.
-
*/
-
public int flags = 0;
-
/**
-
* The required smallest screen width the application can run on. If 0,
-
* nothing has been specified. Comes from
-
* {@link android.R.styleable#AndroidManifestSupportsScreens_requiresSmallestWidthDp
-
* android:requiresSmallestWidthDp} attribute of the tag.
-
*/
-
public int requiresSmallestWidthDp = 0;
-
/**
-
* The maximum smallest screen width the application is designed for. If 0,
-
* nothing has been specified. Comes from
-
* {@link android.R.styleable#AndroidManifestSupportsScreens_compatibleWidthLimitDp
-
* android:compatibleWidthLimitDp} attribute of the tag.
-
*/
-
public int compatibleWidthLimitDp = 0;
-
/**
-
* The maximum smallest screen width the application will work on. If 0,
-
* nothing has been specified. Comes from
-
* {@link android.R.styleable#AndroidManifestSupportsScreens_largestWidthLimitDp
-
* android:largestWidthLimitDp} attribute of the tag.
-
*/
-
public int largestWidthLimitDp = 0;
-
/**
-
* Full path to the location of this package.
-
*/
-
public String sourceDir;
-
/**
-
* Full path to the location of the publicly available parts of this
-
* package (i.e. the primary resource package and manifest). For
-
* non-forward-locked apps this will be the same as {@link #sourceDir).
-
*/
-
public String publicSourceDir;
-
/**
-
* Full paths to the locations of extra resource packages this application
-
* uses. This field is only used if there are extra resource packages,
-
* otherwise it is null.
-
*
-
* {@hide}
-
*/
-
public String[] resourceDirs;
-
/**
-
* Paths to all shared libraries this application is linked against. This
-
* field is only set if the {@link PackageManager#GET_SHARED_LIBRARY_FILES
-
* PackageManager.GET_SHARED_LIBRARY_FILES} flag was used when retrieving
-
* the structure.
-
*/
-
public String[] sharedLibraryFiles;
-
/**
-
* Full path to a directory assigned to the package for its persistent
-
* data.
-
*/
-
public String dataDir;
-
/**
-
* Full path to the directory where native JNI libraries are stored.
-
*/
-
public String nativeLibraryDir;
-
/**
-
* 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 int uid;
-
/**
-
* 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 {@link android.os.Build.VERSION_CODES#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 int targetSdkVersion;
-
/**
-
* When false, indicates that all components within this application are
-
* considered disabled, regardless of their individually set enabled status.
-
*/
-
public boolean enabled = true;
-
/**
-
* For convenient access to the current enabled setting of this app.
-
* @hide
-
*/
-
public int enabledSetting = PackageManager.COMPONENT_ENABLED_STATE_DEFAULT;
-
/**
-
* For convenient access to package’s install location.
-
* @hide
-
*/
-
public int installLocation = PackageInfo.INSTALL_LOCATION_UNSPECIFIED;
-
public void dump(Printer pw, String prefix) {
-
super.dumpFront(pw, prefix);
-
if (className != null) {
-
pw.println(prefix + “className=” + className);
-
}
-
if (permission != null) {
-
pw.println(prefix + “permission=” + permission);
-
}
-
pw.println(prefix + “processName=” + processName);
-
pw.println(prefix + “taskAffinity=” + taskAffinity);
-
pw.println(prefix + “uid=” + uid + " flags=0x" + Integer.toHexString(flags)
-
+ " theme=0x" + Integer.toHexString(theme));
-
pw.println(prefix + “requiresSmallestWidthDp=” + requiresSmallestWidthDp
-
+ " compatibleWidthLimitDp=" + compatibleWidthLimitDp
-
+ " largestWidthLimitDp=" + largestWidthLimitDp);
-
pw.println(prefix + “sourceDir=” + sourceDir);
-
if (sourceDir == null) {
-
if (publicSourceDir != null) {
-
pw.println(prefix + “publicSourceDir=” + publicSourceDir);
-
}
-
} else if (!sourceDir.equals(publicSourceDir)) {
-
pw.println(prefix + “publicSourceDir=” + publicSourceDir);
-
}
-
if (resourceDirs != null) {
-
pw.println(prefix + “resourceDirs=” + resourceDirs);
-
}
-
pw.println(prefix + “dataDir=” + dataDir);
-
if (sharedLibraryFiles != null) {
-
pw.println(prefix + “sharedLibraryFiles=” + sharedLibraryFiles);
-
}
-
pw.println(prefix + “enabled=” + enabled + " targetSdkVersion=" + targetSdkVersion);
-
if (manageSpaceActivityName != null) {
-
pw.println(prefix + “manageSpaceActivityName=”+manageSpaceActivityName);
-
}
-
if (descriptionRes != 0) {
-
pw.println(prefix + “description=0x”+Integer.toHexString(descriptionRes));
-
}
-
if (uiOptions != 0) {
-
pw.println(prefix + “uiOptions=0x” + Integer.toHexString(uiOptions));
-
}
-
pw.println(prefix + “supportsRtl=” + (hasRtlSupport() ? “true” : “false”));
-
super.dumpBack(pw, prefix);
-
}
-
/**
-
* @return true if “supportsRtl” has been set to true in the AndroidManifest
-
* @hide
-
*/
-
public boolean hasRtlSupport() {
-
return (flags & FLAG_SUPPORTS_RTL) == FLAG_SUPPORTS_RTL;
-
}
-
public static class DisplayNameComparator
-
implements Comparator {
-
public DisplayNameComparator(PackageManager pm) {
-
mPM = pm;
-
}
-
public final int compare(ApplicationInfo aa, ApplicationInfo ab) {
-
CharSequence sa = mPM.getApplicationLabel(aa);
-
if (sa == null) {
-
sa = aa.packageName;
-
}
-
CharSequence sb = mPM.getApplicationLabel(ab);
-
if (sb == null) {
-
sb = ab.packageName;
-
}
-
return sCollator.compare(sa.toString(), sb.toString());
-
}
-
private final Collator sCollator = Collator.getInstance();
-
private PackageManager mPM;
-
}
-
public ApplicationInfo() {
-
}
-
public ApplicationInfo(ApplicationInfo orig) {
-
super(orig);
-
taskAffinity = orig.taskAffinity;
-
permission = orig.permission;
-
processName = orig.processName;
-
className = orig.className;
-
theme = orig.theme;
-
flags = orig.flags;
-
requiresSmallestWidthDp = orig.requiresSmallestWidthDp;
-
compatibleWidthLimitDp = orig.compatibleWidthLimitDp;
-
largestWidthLimitDp = orig.largestWidthLimitDp;
-
sourceDir = orig.sourceDir;
-
publicSourceDir = orig.publicSourceDir;
-
nativeLibraryDir = orig.nativeLibraryDir;
-
resourceDirs = orig.resourceDirs;
-
sharedLibraryFiles = orig.sharedLibraryFiles;
-
dataDir = orig.dataDir;
-
uid = orig.uid;
-
targetSdkVersion = orig.targetSdkVersion;
-
enabled = orig.enabled;
-
enabledSetting = orig.enabledSetting;
-
installLocation = orig.installLocation;
-
manageSpaceActivityName = orig.manageSpaceActivityName;
-
descriptionRes = orig.descriptionRes;
-
uiOptions = orig.uiOptions;
-
backupAgentName = orig.backupAgentName;
-
}
-
public String toString() {
-
return “ApplicationInfo{”
-
+ Integer.toHexString(System.identityHashCode(this))
-
+ " " + packageName + “}”;
-
}
-
public int describeContents() {
-
return 0;
-
}
-
public void writeToParcel(Parcel dest, int parcelableFlags) {
-
super.writeToParcel(dest, parcelableFlags);
-
dest.writeString(taskAffinity);
-
dest.writeString(permission);
-
dest.writeString(processName);
-
dest.writeString(className);
-
dest.writeInt(theme);
-
dest.writeInt(flags);
-
dest.writeInt(requiresSmallestWidthDp);
-
dest.writeInt(compatibleWidthLimitDp);
-
dest.writeInt(largestWidthLimitDp);
-
dest.writeString(sourceDir);
-
dest.writeString(publicSourceDir);
-
dest.writeString(nativeLibraryDir);
-
dest.writeStringArray(resourceDirs);
-
dest.writeStringArray(sharedLibraryFiles);
-
dest.writeString(dataDir);
-
dest.writeInt(uid);
-
dest.writeInt(targetSdkVersion);
-
dest.writeInt(enabled ? 1 : 0);
-
dest.writeInt(enabledSetting);
-
dest.writeInt(installLocation);
-
dest.writeString(manageSpaceActivityName);
-
dest.writeString(backupAgentName);
-
dest.writeInt(descriptionRes);
-
dest.writeInt(uiOptions);
-
}
-
public static final Parcelable.Creator CREATOR
面试复习路线,梳理知识,提升储备
自己的知识准备得怎么样,这直接决定了你能否顺利通过一面和二面,所以在面试前来一个知识梳理,看需不需要提升自己的知识储备是很有必要的。
关于知识梳理,这里再分享一下我面试这段时间的复习路线:(以下体系的复习资料是我从各路大佬收集整理好的)
- 架构师筑基必备技能
- Android高级UI与FrameWork源码
- 360°全方面性能调优
- 解读开源框架设计思想
- NDK模块开发
- 微信小程序
- Hybrid 开发与Flutter
知识梳理完之后,就需要进行查漏补缺,所以针对这些知识点,我手头上也准备了不少的电子书和笔记,这些笔记将各个知识点进行了完美的总结:
《960全网最全Android开发笔记》
《379页Android开发面试宝典》
历时半年,我们整理了这份市面上最全面的安卓面试题解析大全
包含了腾讯、百度、小米、阿里、乐视、美团、58、猎豹、360、新浪、搜狐等一线互联网公司面试被问到的题目。熟悉本文中列出的知识点会大大增加通过前两轮技术面试的几率。
如何使用它?
1.可以通过目录索引直接翻看需要的知识点,查漏补缺。
2.五角星数表示面试问到的频率,代表重要推荐指数
《507页Android开发相关源码解析》
只要是程序员,不管是Java还是Android,如果不去阅读源码,只看API文档,那就只是停留于皮毛,这对我们知识体系的建立和完备以及实战技术的提升都是不利的。
真正最能锻炼能力的便是直接去阅读源码,不仅限于阅读各大系统源码,还包括各种优秀的开源库。
网上学习资料一大堆,但如果学到的知识不成体系,遇到问题时只是浅尝辄止,不再深入研究,那么很难做到真正的技术提升。
一个人可以走的很快,但一群人才能走的更远!不论你是正从事IT行业的老鸟或是对IT行业感兴趣的新人,都欢迎加入我们的的圈子(技术交流、学习资源、职场吐槽、大厂内推、面试辅导),让我们一起学习成长!
-
dest.writeInt(targetSdkVersion);
-
dest.writeInt(enabled ? 1 : 0);
-
dest.writeInt(enabledSetting);
-
dest.writeInt(installLocation);
-
dest.writeString(manageSpaceActivityName);
-
dest.writeString(backupAgentName);
-
dest.writeInt(descriptionRes);
-
dest.writeInt(uiOptions);
-
}
-
public static final Parcelable.Creator CREATOR
面试复习路线,梳理知识,提升储备
自己的知识准备得怎么样,这直接决定了你能否顺利通过一面和二面,所以在面试前来一个知识梳理,看需不需要提升自己的知识储备是很有必要的。
关于知识梳理,这里再分享一下我面试这段时间的复习路线:(以下体系的复习资料是我从各路大佬收集整理好的)
- 架构师筑基必备技能
- Android高级UI与FrameWork源码
- 360°全方面性能调优
- 解读开源框架设计思想
- NDK模块开发
- 微信小程序
- Hybrid 开发与Flutter
[外链图片转存中…(img-CnBTizVZ-1715434257960)]
知识梳理完之后,就需要进行查漏补缺,所以针对这些知识点,我手头上也准备了不少的电子书和笔记,这些笔记将各个知识点进行了完美的总结:
[外链图片转存中…(img-ZFzeeEUy-1715434257960)]
《960全网最全Android开发笔记》
[外链图片转存中…(img-C4q26Nm6-1715434257960)]
《379页Android开发面试宝典》
历时半年,我们整理了这份市面上最全面的安卓面试题解析大全
包含了腾讯、百度、小米、阿里、乐视、美团、58、猎豹、360、新浪、搜狐等一线互联网公司面试被问到的题目。熟悉本文中列出的知识点会大大增加通过前两轮技术面试的几率。
如何使用它?
1.可以通过目录索引直接翻看需要的知识点,查漏补缺。
2.五角星数表示面试问到的频率,代表重要推荐指数
[外链图片转存中…(img-prdDPtUw-1715434257961)]
《507页Android开发相关源码解析》
只要是程序员,不管是Java还是Android,如果不去阅读源码,只看API文档,那就只是停留于皮毛,这对我们知识体系的建立和完备以及实战技术的提升都是不利的。
真正最能锻炼能力的便是直接去阅读源码,不仅限于阅读各大系统源码,还包括各种优秀的开源库。
网上学习资料一大堆,但如果学到的知识不成体系,遇到问题时只是浅尝辄止,不再深入研究,那么很难做到真正的技术提升。
一个人可以走的很快,但一群人才能走的更远!不论你是正从事IT行业的老鸟或是对IT行业感兴趣的新人,都欢迎加入我们的的圈子(技术交流、学习资源、职场吐槽、大厂内推、面试辅导),让我们一起学习成长!