09 January 2015

getInstalledApplications vs getInstalledPackages


  • PackageManager.getInstalledPackages(int flags)on the other hand, will provide you information regarding all AndroidManifest's elements, such as declared activities, services, receivers, meta-data
    • Returns: A List of PackageInfo objects
    • PackageInfo contains ApplicationInfo


  • PackageManager.getInstalledApplications(int flags)  will provide you information regarding the AndroidManifest's Application tag, and just about it. Forget about activities, receivers, services and go on.
    • Returns: Returns a List of ApplicationInfo
    • ApplicationInfo 


PackageInfo properties:
  • applicationInfo - ApplicationInfo
  • packageName - String
  • versionName - String
  • versionCode - int
  • permissions - PermissionInfo[] : (.GET_PERMISSIONS )
ApplicationInfo properties:
  • className - String
  • packageName - String
  • processName - String (The name of the process this application should run in. From the "process" attribute or, if not set, the same as packageName)
  • permission(needed by other to call this app) - String
  • dataDir
  • sourceDir
  • publicSourceDir
  • nativeLibraryDir
  • sharedLibraryFiles - String[]  : (GET_SHARED_LIBRARY_FILES )

No comments:

Post a Comment

Terima kasih