`
svyee
  • 浏览: 23758 次
  • 性别: Icon_minigender_1
  • 来自: 福建
最近访客 更多访客>>
社区版块
存档分类
最新评论

How to launch an application with its UID

阅读更多

We can launch any application installed on a device with it's UID rather using the name of the application .

  • By this way we can prevent the name clashes.
  • No need for searching for the full path of the application.

In mmp file:

LIBRARY        apgrfx.lib // for RApaLsSession
LIBRARY        apparc.lib // for CApaCommandLine, TApaAppInfo
 

Source code

// System Includes
#include <apgcli.h> // for RApaLsSession
#include <apacmdln.h> // for CApaCommandLine
 
// ...
 
// ----------------------------------------------------------------------------
// CMyUtility::LaunchAppL(const TUid aAppUid)
// Find the application with it's UID and if exists then launch the 
// application to the foreground.
// ----------------------------------------------------------------------------
//
void CMyUtility::LaunchAppL(const TUid aAppUid) const
    {
    RApaLsSession apaLsSession;
    User::LeaveIfError(apaLsSession.Connect());
    CleanupClosePushL(apaLsSession);
 
    TApaAppInfo appInfo;
    TInt retVal = apaLsSession.GetAppInfo(appInfo, aAppUid);
 
    if(retVal == KErrNone)
        {
        CApaCommandLine* cmdLine = CApaCommandLine::NewLC();
        cmdLine->SetExecutableNameL(appInfo.iFullName);
        cmdLine->SetCommandL(EApaCommandRun);
        User::LeaveIfError( apaLsSession.StartApp(*cmdLine) );
 
        CleanupStack::PopAndDestroy(cmdLine);
        }
    else
        {
        // The application not found!
        }
 
    CleanupStack::PopAndDestroy(&apaLsSession);
    }
分享到:
评论
1 楼 zhiqi0158 2009-09-11  
如果我想找application uid呢,在哪里可以查到?
比方说日历的

相关推荐

    android sdk 自带 实例(samples)

    An application that demonstrates how to launch the built-in contact picker from within an activity. This sample also uses reflection to ensure that the correct version of the contacts API is used, ...

    NeoStart-android_launch_application.rar

    NeoStart-android_launch_application

    Launch and wait application to end (8KB)

    标题“Launch and wait application to end (8KB)”指的是一个小型程序或者代码片段,其主要功能是启动一个应用程序并等待该程序执行结束。这个程序可能只有8KB大小,因此它可能是高度优化的,专注于核心功能,以...

    Performance Testing with Jmeter

    product launch and its maintenance. It also plays an integral part in scaling an application out to support a wider user base. Apache JMeter is a free open source, cross-platform, performance testing ...

    宏基快捷键驱动(launchmanager) v3.0.02 官方免费版

    ACER宏基笔记本LaunchManager快捷键设置工具LaunchManager是ACER公司为其笔记本用户开发的快捷键设置工具,用户可以使用默认的程序启动热键,如ie、邮箱等,也可以自定义相关程序,实现快速启动,欢迎下载体验

    Learning.NET.High.Performance.Programming

    If you are a .NET developer with an understanding of application development, but want to learn how to optimize the performance of your applications, this is the book for you. Basic knowledge of C# is...

    Mini Alarms

    Mini Alarms is an application by which the user can add, delete, modify, ... To launch this application when system starts, users can add a shortcut of this application to menu "Start-&gt;Startup".

    Android代码-spring-boot-kotlin-demo

    You can launch the application with by running: $ ./gradlew bootRun This project uses kotlin-spring plugin to avoid requiring open modifier on proxified classes and methods, see this blog post for ...

    Cramming_for_FISMA_How_to_Launch_a_NIST_800_53_Moderate_Syst

    Cramming_for_FISMA_How_to_Launch_a_NIST_800_53_Moderate_System_in_180_Days 业务风控 安全架构业务风控 企业安全 APT

    Kubernetes for Serverless Applications

    Chapter 2, An Introduction to Kubernetes, discusses what Kubernetes is, what problems it solves, and also takes a look at its backstory, from internal engineering tool at Google to an open source ...

    Learning Docker

    What You Will LearnDevelop containerized applications using the Docker version 17.03Build Docker images from containers and launch themDevelop Docker images and containers leveraging DockerfilesUse ...

    CS193P IOS APPLICATION DEVELOPMENT Assignment 1 Walkthrough.pdf

    - Select the "View-based Application" template to create a basic user interface along with a controller subclass. 3. **Defining a Model, View, and Controller (MVC):** This step involves ...

    AWS.System.Administration

    System administrators will learn how to integrate their favorite tools and processes, while developers will pick up enough system administration knowledge to build a robust and resilient AWS ...

    动画小效果,模仿nice应用

    【标题】:“动画小效果,模仿nice应用” 这个标题揭示了我们要探讨的知识点是关于创建一个类似Nice应用的动画效果。Nice是一款广受欢迎的社交应用,以其独特的用户体验和视觉设计吸引了大量用户。...

    VB编程资源大全(英文源码 表单)

    diffusion texture and if you understand all this graphical/mathematical stuff then its very good.&lt;END&gt;&lt;br&gt;44,filedirector.zip This is an application I wrote to work in conjunction with the "Windows...

    Learning Angular 2.pdf

    This is where this book comes in—its goal is to avoid bloating the reader with API references and framework descriptions, but to embrace a hands-on approach, helping the reader learn how to leverage ...

Global site tag (gtag.js) - Google Analytics