There are two methods to retrieve the installed application information, asynchronous and synchronous. We suggest the async method as it shouldn't affect the ui as much as the synchronous method may do, depending on the device and the number of applications installed.
Which ever method you use, the end result is an
PackageInfo objects. These objects contain:
packageName: The java package name of the application
label: The name of the application
versionName: The version name of this package, as specified by the manifest tag's
versionCode: The version code for the application
along with other information detailed in the asdocs.
In order to retrieve a list of applications that are installed on the device call the
You can use either a callback passed to the function or listen for the
PackageManagerEvent.GET_INSTALLED_APPLICATIONS event (or both)
Listening for the event involves adding a listener for
PackageManagerEvent.GET_INSTALLED_APPLICATIONS and then processing the result in the handler:
Alternatively you can do the similar thing with a callback:
You can also call
getInstalledApplications() to directly retrieve an array of the application package information however be aware that this call may take some time.