---
title: "如何在S60 3rd的手机上显示所有已安装程序的Uid"
author: "svyee"
date: "2009-06-21T00:25:16Z"
tags: []
slug: "s60-3rd-uid"
draft: false
lastmod: "2009-06-21T00:29:24Z"
id: 412194
url: "https://svyee.iteye.com/blog/412194"
---

一个应用程序它可以显示设备上所有已安装程序的Uid。

该程序从S60 2.x 移植到 S60 3.x

S60 2.x的源代码可以在Forum Nokia 找到，下面的代码是S60 3.0的。

**概要：**

以下代码将显示手机上安装的应用程序的Uid，它使用了下面的类。

```
RApaLsSession    iLsSession;
MAppUidObserver& iObserver;
RArray<TAppInfo> iApps;

class TAppInfo
{
public:
    TInt32 iAppUid;
    TApaAppCaption iAppCaption;               
};

void CAppUidViewerEngine::AppsToUiL()
{
    TApaAppInfo apaAppInfo;
    TAppInfo appInfo;
    iApps.Reset();

    // Get info on all apps, then iterate through each app
    User::LeaveIfError(iLsSession.GetAllApps());
    while(iLsSession.GetNextApp(apaAppInfo) == KErrNone)
    {
        appInfo.iAppCaption = apaAppInfo.iCaption;
        appInfo.iAppUid = apaAppInfo.iUid.iUid;
        User::LeaveIfError(iApps.Append(appInfo));
    }
               
    //  iObserver.AppsFoundL(iApps);
}
```

 以上主要代码。

相关链接：[英文原文How to Display the Uid of Applications installed on 3.0 phones](http://www.newlc.com/How-to-Display-the-Uid-of.html)  
下载： [源代码](http://www.newlc.com/files/AppUidViewer-2.zip "AppUidViewer-2.zip") 、[Sis文件](http://www.newlc.com/files/appuidviewer.sis "appuidviewer.sis")