Installed Application Info
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 Array
of PackageInfo
objects. These objects contain:
packageName
: The java package name of the applicationlabel
: The name of the applicationversionName
: The version name of this package, as specified by the manifest tag'sversionName
attributeversionCode
: The version code for the application
along with other information detailed in the asdocs.
Asynchronous retrieval
In order to retrieve a list of applications that are installed on the device call the getInstalledApplicationsAsync()
function.
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:
Synchronous retrieval
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.