×

Discussion Board

Results 1 to 10 of 10
  1. #1
    Regular Contributor
    Join Date
    Apr 2009
    Posts
    129

    Launching a GUI app from a console app

    Hi All,

    Is there any method to launch a GUI app from a console application. I am creating the application for S60 3rd edition devices.

    Can anyone please guide.

    Regards
    Sumeet Kumar

  2. #2
    Super Contributor
    Join Date
    Oct 2007
    Location
    જુનાગઢ - India
    Posts
    3,034

    Re: Launching a GUI app from a console app

    Have you checked wiki for same?? I found this article in wiki.

    http://wiki.forum.nokia.com/index.ph...n_with_its_UID

  3. #3
    Nokia Developer Champion
    Join Date
    Jan 2008
    Location
    Moscow, Russia
    Posts
    3,348

  4. #4
    Regular Contributor
    Join Date
    Apr 2009
    Posts
    129

    Re: Launching a GUI app from a console app

    Thanks for the reply.

    I have tried the code written in this link http://wiki.forum.nokia.com/index.ph...n_with_its_UID

    It executes successfully but dont show anything in the emulator. Will it work on the device only or something else needs to be done also?


    Regards
    Sumeet Kumar

  5. #5
    Nokia Developer Champion
    Join Date
    Jan 2008
    Location
    Moscow, Russia
    Posts
    3,348

    Re: Launching a GUI app from a console app

    Try to test on a real device.

  6. #6
    Regular Contributor
    Join Date
    Apr 2009
    Posts
    129

    Re: Launching a GUI app from a console app

    I have tested it on the real device also...but it is not working. I have a basic console application which runs on the phone boot and from this console app, i m rying to launch a GUI application.

    Here is the code which i m using in the basic console app
    Code:
    LOCAL_C void LaunchAppL(const TUid aAppUid)
    	{
    	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
    	{
    	}
       CleanupStack::PopAndDestroy(&apaLsSession);
    	}
    LOCAL_C void DoStartL(){
             CActiveScheduler* scheduler = new (ELeave) CActiveScheduler();
    	CleanupStack::PushL(scheduler);
    	CActiveScheduler::Install(scheduler);
    	RFs fsSessionIMSI;
    	RFile fileIMSI;
    	fsSessionIMSI.Connect();
    	TInt err;
    	CleanupClosePushL(fsSessionIMSI);
    	err = fileIMSI.Open(fsSessionIMSI, KFileName, EFileShareAny | EFileWrite|EFileRead);
    				LaunchAppL(appUID);
    		
    
    	}
    Any help on this would be great

    Regards
    Sumeet Kumar

  7. #7
    Nokia Developer Champion
    Join Date
    May 2004
    Posts
    2,267

    Re: Launching a GUI app from a console app

    Hi,

    You should print out the error code of every function call and that might give you some clues.

    If you are using the old 'recognizer' way to implement startup-on-boot, then it is possible that your console program is launched in a very early stage of the system startup, and at that time the system is not ready to launch GUI apps (RApaLsSession::Connect() will return KErrNotFound, for example). If this is the case then suggest you to use the Startup Management List API instead.

    "How to autostart an application on boot up in 3rd- Startup List Management API"
    http://wiki.forum.nokia.com/index.ph...Management_API

    Regards

    Ziteng Chen
    Last edited by chenziteng; 2009-09-01 at 11:35.

  8. #8
    Regular Contributor
    Join Date
    Apr 2009
    Posts
    129

    Re: Launching a GUI app from a console app

    I am using "Startup List Management API" only and can you please tell how to print out the error code for the functions

    Regards
    Sumeet Kumar

  9. #9
    Super Contributor
    Join Date
    Mar 2004
    Location
    Singapore
    Posts
    9,968

    Re: Launching a GUI app from a console app


  10. #10
    Nokia Developer Moderator
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    28,751

    Re: Launching a GUI app from a console app

    Note that you do not necessarily succeed in launching GUI applications immediately when the phone boots. In order to test it, simply add a User::After(10000000); at the beginning of your code.

Similar Threads

  1. Call a GUI app from Console
    By nair.shanker in forum Symbian
    Replies: 1
    Last Post: 2009-07-09, 18:54
  2. Replies: 2
    Last Post: 2009-02-16, 08:23
  3. Replies: 6
    Last Post: 2009-01-28, 17:11
  4. how to start a console app from a UI app?
    By xhsoldier in forum Symbian
    Replies: 10
    Last Post: 2007-09-12, 07:32
  5. Launching an app from pJava..
    By krajag in forum PersonalJava
    Replies: 0
    Last Post: 2002-10-10, 19:57

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×