Get list of installed applications and its UID in Qt
Deprecated:This code snippets shows how to list the names and UIDs of installed applications on device using the Qt Mobile Extension XQInstaller.
Article Metadata
Code Example
Source file: Media:QtGetInstalledApps.zip
Tested with
Devices(s): Nokia 5800 XpressMusic
Compatibility
Platform(s): S60 3rd Edition, FP1, FP2
S60 5th Edition
S60 5th Edition
Platform Security
Signing Required: DevCert
Capabilities: TrustedUI
Article
Keywords: XQInstaller::applications()
Created: savaj
(22 Jun 2009)
Last edited: hamishwillee
(11 Oct 2012)
Contents |
Headers required
#include <XQInstaller>.pro file
symbian:LIBS += -lswinstcli \
-lcommdb \
-lapparc \
-lefsrv \
-lapgrfx
symbian:TARGET.CAPABILITY += TrustedUI
Source
void GetInstalledApps::GetApps()
{
XQInstaller* m_installer = new XQInstaller(this);
/* Get List of applications.
* type of m_applications is QMap<QString, uint>.
*/
m_applications = m_installer->applications();
/* Get List of application names
*type of m_appNames is QList<QString>
*/
m_appNames = m_applications.keys();
/* Get List of application UID in decimal.
*type of m_appUID is QList<uint>
*/
m_appUID = m_applications.values();
ui.listWidget->clear();
for (int i = 0; i < m_appNames.count(); i++)
{
QString str;
/* convert UID from decimal to hex and then string. */
str.setNum(m_appUID.at(i),16);
/* append name and UID to string */
QString string(m_appNames.at(i)+" UID:"+ str);
/* append string to list widget to display on screen */
ui.listWidget->addItem(string);
}
/* Let's make the UI scale so that we can scroll it. */
QScrollArea* scrollArea = new QScrollArea;
scrollArea->setWidget(ui.listWidget);
scrollArea->setWidgetResizable(true);
/* setCentralWidget() takes ownership of scrollArea and deletes it at the appropriate time. so no need to delete scrollArea */
setCentralWidget(scrollArea);
}
Postconditions
The code snippet is expected to show a list of all installed applicationa with its UID.
Code Example
- The Code Example will show a list of all installed application with UID. The application is tested on Nokia 5800 XpressMusic.


23 Sep
2009
This article shows how to get installed application names and it’s UID. And there is also mentioned that this widget requires TrustedUI Capabilities and needs a developer certificate. And this article is also tested in nokia 5800.
This article is explained with a code snippet and also with a snapshot so that is the good thing. It uses a XQInstaller API and a method applications() of that class.
Fine Explained with snapshots…
This article should be rewritten/deleted
The API promoted is deprecated, the capability requirements are too high for the illustrated use case, some of the libraries included are not needed (and not available in the SDK). I would actually suggest that it should be deleted. ltomuta 06:22, 6 April 2011 (UTC)
What replaces it?
I would actually suggest that it should be deleted.
There isn't a Qt Mobility API that lists the Symbian tasks and its a legitimate if minor use case. I'd rather not delete an article that "works" if there is no valid alternative ... and I suspect there is no other way to get the list of installed applications except by talking to the software installer, which is always going to require TrustedUI.
If there is an alternative, we could clean this up.
hamishwillee 07:23, 6 April 2011 (UTC)