×
Namespaces

Variants
Actions

如何显示安装在3.0手机上的程序UID

From Nokia Developer Wiki
Jump to: navigation, search
Article Metadata

文章
翻译:
hoolee
最后由 hamishwillee 在 22 Dec 2011 编辑


如果你要查找安装在你第三版手机上的程序的UID,那么可以按照下列方法来处理:

概述

下列代码列出你手机上安装的所有程序的UID

RApaLsSession iLsSession;
MAppUidObserver& iObserver;
RArray<TAppInfo> iApps;
class MAppUidObserver {
public:
virtual void AppsFoundL(RArray<TAppInfo> aAppList) = 0;
};
       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);
}

上述代码将获取程序的UID,并将它们添加到数组,然后传递到view类中予以显示。

This page was last modified on 22 December 2011, at 07:48.
107 page views in the last 30 days.
×