`
svyee
  • 浏览: 23025 次
  • 性别: 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, ...

    Introduction.to.Android.Application.Development(4th,2013.12) pdf

    Adding Logging Support to Your Android Application 83 Adding Some Media Support to Your Application 84 Adding Location-Based Services to Your Application 88 Debugging Your Application on Hardware 90 ...

    Launch and wait application to end (8KB)

    Launch and wait application to end (8KB)

    Learning iOS Programming, 2nd Edition.pdf

    how to use custom URL schemes to launch your application. It also discusses how to make use of the Media Player and Address Book. Chapter 13, Distributing Your Application This chapter talks about how...

    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 ...

    Hands-On Blockchain with Hyperledger 2018

    You will learn how to configure Hyperledger Fabric and become familiar with its architectural components. Using these components, you will learn to build private blockchain networks, along with the ...

    Designing.BSD.Rootkits.An.Introduction.to.Kernel.Hacking

    Author Joseph Kong's goal is to make you smarter, not to teach you how to write exploits or launch attacks. You'll learn how to maintain root access long after gaining access to a computer and how to...

    User control to launch web browser and jump to URL.

    User control to launch web browser and jump to URL.

    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 ...

    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...

    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 ...

    Packt.Native.Docker.Clustering.with.Swarm

    how to filter and schedule containers over the cluster, launch them as services, handle containers as tasks. We’ll start defining a web service with Nginx, then we’ll deploy a mandatory Wordpress ...

    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 ...

    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首页的效果的小例子,可以参考参考

    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 ...

    UE(官方下载)

    How to enable and disable autocorrect keywords with syntax highlighting Insert Menu Commands UltraEdit includes several special insert functions under the Insert menu. You can use these functions to ...

Global site tag (gtag.js) - Google Analytics