如果你要找出“第三版手机安装的全部程序UID”,那么可以按照下列方法来做:
概述
下列代码将显示安装到手机上所有程序的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);
}
上述代码片段会将所有程序UID增加一个数组中并在view类中加以显示。
No related wiki articles found