Difference between ApplicationInfo and PackageInfo?

拟墨画扇 提交于 2019-12-01 15:46:28
Mukund Samant
  1. Can someone describe the difference between ApplicationInfo and PackageInfo?

    PackageInfo represents the entire AndroidManifest.xml.ApplicationInfo is actually a field/attribute of PackageInfo,refering only to the application tag. Refer this.

  2. How do they correlate with each other?

    As I mentioned ApplicationInfo is actually an attribute/field of PackageInfo which itself happens to be a complex object and has its own methods/fields.

  3. In which cases ApplicationInfo is used and when PackageInfo is used?

    To access information within application tag which could be related to services or actvities or broadcast receivers we use ApplicationInfo.Data related to the rest of the AndroidManifest.xml can be obtained via the other fields/methods in PackageInfo class

PackageInfo contains ApplicationInfo (PackageInfo.applicationInfo).

Package info is all your info from your manifest file, ApplicaitonInfo is the info from the <application> tag in your manifest.

When they are used? it depends on which info you a looking for , or which API methods you are using.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!