×

Discussion Board

Page 1 of 2 12 LastLast
Results 1 to 15 of 19
  1. #1
    Registered User
    Join Date
    Feb 2009
    Posts
    9

    display autostart in Qt application ?

    hi,

    I am wiritting application with Qt 461 for symbian, my appkication must autostart, but for signed i must put
    option for user to display autostat in the interface of application.

    for integrate autostart i used:
    http://wiki.forum.nokia.com/index.ph...Qt_for_Symbian

    but i don't know who put option to display or enable autostart in my Qt application ?
    i have looke to the code in web :
    TBool ..::ProcessCommandParametersL(CApaCommandLine &aCommandLine)
    {
    iEikonEnv->RootWin().SetOrdinalPosition(-1);
    User::After(6000000);
    if(aCommandLine.OpaqueData().Length() > 0)
    {
    // Opaque data exists, app. was manually started from the menu
    }
    else
    {
    // App. was auto-started ->exit if auto-start flag in settings is OFF
    }

    return QtS60_PrayerTimes::ProcessCommandParametersL( aCommandLine );
    }

    plase where can i put this code ? in main.cpp or in myprog.cpp or in myprog.h ?

    thanks

  2. #2
    Regular Contributor
    Join Date
    Oct 2008
    Location
    Oslo, Norway
    Posts
    329

    Re: display autostart in Qt application ?

    Hi,

    As the code you're refererring to is supposed to be implemented in CAknAppUi::ProcessCommandParametersL(), there is no easy solution for a Qt application.

    There is the static function CApaCommandLine::GetCommandLineFromProcessEnvironment(), but that doesn't seem to work; I tested it and opaque data is always zero, even if it was defined in the registration resource file.

    You might want to consider writing a separate (non-GUI) application to add on the startup list. This 'launcher' app would then store the autostart setting, and launch the actual app if the autostart feature is set.

    As you probably want to have a user-configurable UI option for it, you'll need to store the setting in such a manner that both processes (launcher + main app) can access it. One solution is to save a config file in c:\system\data\<myappconfigfile.ini>, as \system folder is not protected by platform security and therefore does not require any capabilities for read/write access.

  3. #3
    Regular Contributor
    Join Date
    Sep 2008
    Posts
    286

    Re: display autostart in Qt application ?

    I quickly glanced at the linked documentation and I don't see any issue with this being implemented in pure Qt level. Requirements where that default autostart is to be set off. and user can set it to on/off.
    Have QSetting to have save the state and check for that in your main().

    pseudo main:
    if (autostart)
    startmodebootup=true
    else if (startmodebootup)
    //with auto,app killed, started from menu
    else
    //without auto, started from menu

    pseudo select(option):
    autostart=(option)

  4. #4
    Registered User
    Join Date
    Feb 2009
    Posts
    9

    Re: display autostart in Qt application ?

    Hi;

    The probleme in my Qt application, is who can know if the application is run by user or in boot of devise in reboot ?

    help me please, it s a cretical for signing my application

  5. #5
    Regular Contributor
    Join Date
    Oct 2008
    Location
    Oslo, Norway
    Posts
    329

    Re: display autostart in Qt application ?

    Hi,

    As HAF said, the problem is in detecting if an application has been launched from the startup list of from the menu. Startup list manager seems to launch the application exe directly, omitting any definitions in the app registration resource file. In a native Symbian app we can use this knowledge to decide whether to always run (when launched from the menu) or exit if autostart feature is turned off (when launched from startup list).

    I don't see how using QSettings alone would solve this, the only way to work around this (in my experience) is to have a separate launcher application.

    I wrote an article about this, look here.
    Last edited by treinio; 2010-02-04 at 16:24. Reason: typo

  6. #6
    Registered User
    Join Date
    Feb 2009
    Posts
    9

    Re: display autostart in Qt application ?

    Hi,

    Thanks very well to treinio.

    His exemple has resolve my probleme to display-enable autostart.

    HAF

  7. #7
    Registered User
    Join Date
    Feb 2009
    Posts
    9

    Re: display autostart in Qt application ?

    Hi,

    Thanks for your help in your article.

    I have take the example to made my Qt a option to user to display or enable autostart

    my application is for S60v5, s60v31 and s60v32. then i must use 3 differents sdk in my projet in carbidec++
    I have make autostartdefs.pri like this :
    # S60 SDK root path (modify if needed)
    #symbiansdk = "/S60/devices/S60_5th_Edition_SDK_v1.0"
    symbiansdk = "/Symbian/9.2/S60_3rd_FP1_9"
    #symbiansdk = "/S60/devices/S60_3rd_FP2_SDK_v1.1"

    # UID of the application that will be launched (change to a unique one)
    TARGET.UID3 = 0x2002C689

    # Define launcher UID3 (change to a unique one) - do not use '0x' prefix!
    s60launcher.UID3 = "2002C689"

    and i build my project for each sdk

    but in installation on device the installaion make "enable to insall"
    in the moment :
    "/S60/devices/S60_5th_Edition_SDK_v1.0/epoc32/release/$(PLATFORM)/$(TARGET)/as_s60launcher.exe" - "c:\sys\bin\as_myapp.exe"

    please help me

    thanks

  8. #8
    Regular Contributor
    Join Date
    Oct 2008
    Location
    Oslo, Norway
    Posts
    329

    Re: display autostart in Qt application ?

    Quote Originally Posted by HAF View Post
    but in installation on device the installaion make "enable to insall"
    in the moment :
    "/S60/devices/S60_5th_Edition_SDK_v1.0/epoc32/release/$(PLATFORM)/$(TARGET)/as_s60launcher.exe" - "c:\sys\bin\as_myapp.exe"
    You should use different UIDs for your app (TARGET.UID3) and the launcher (s60launcher.UID3) in autostartdefs.pri, as they are two separate executables.

    Also, there shouldn't be any need to do separate builds for 3rd FP1, FP2 & 5th Edition, Qt is cross-platform.

  9. #9
    Regular Contributor
    Join Date
    May 2010
    Posts
    56

    Re: display autostart in Qt application ?

    Quote Originally Posted by treinio View Post
    Hi,

    As the code you're refererring to is supposed to be implemented in CAknAppUi::ProcessCommandParametersL(), there is no easy solution for a Qt application.

    There is the static function CApaCommandLine::GetCommandLineFromProcessEnvironment(), but that doesn't seem to work; I tested it and opaque data is always zero, even if it was defined in the registration resource file.
    Yes it works, however there is a gotcha, you can only call it once, and since QApplication is a wrapper for all the essential Symbian classes, including CAknAppUi, it gets called internally by CAknAppUi::ProcessCommandParametersL, so the easy solution is to call it on your main function before calling QApplication's constructor. It took a lot of guess and reverse engineering work to figure this one out since it's not documented, it's only mentioned on the changes section of the SDK.

  10. #10
    Registered User
    Join Date
    Sep 2004
    Posts
    9

    Re: display autostart in Qt application ?

    Treinio, thanks very much for the article. Unfortunately I can't get it to work. Can you suggest an approach to debugging an application that's meant to autostart?

    For the moment I've taken the resources from your article - http://wiki.forum.nokia.com/index.ph...Qt_for_Symbian - assembled, compiled, signed it with my Dev Cert and deployed to an N95 from QT. The application starts and I'm able to toggle the setting but nothing happens when I restart the handset.

    I've also tried this: http://wiki.forum.nokia.com/index.ph...Qt_for_Symbian and the application attached to the article works in that it starts on boot of my N95, so apparently the autostart API is functioning.

    Any suggestions would be very much appreciated.

  11. #11
    Registered User
    Join Date
    Dec 2006
    Posts
    34

    Re: display autostart in Qt application ?

    Hi treinio,

    One question (might be very stupid), your article here serves the purpose of autostart but does it also help in differentiating autostart and manual/user start ?

    -DJ

  12. #12
    Registered User
    Join Date
    Dec 2006
    Posts
    34

    Re: display autostart in Qt application ?

    Hi,

    got the trick.. just added an argument in s60launcher.cpp by modifying _LIT(KNothing, "1"); and checked the argument count in Qt app's main. argc is 2 after that instead of 1.

    -DJ

  13. #13
    Regular Contributor
    Join Date
    Oct 2008
    Location
    Oslo, Norway
    Posts
    329

    Re: display autostart in Qt application ?

    Hi djagadish7,

    That was not a stupid question, that's indeed a feature that S60AutoStart is currently missing - i'll add that in there. And yes, modifying the command line arguments in s60launcher.cpp is the easiest way to do it.

    phillipfitzsimmons: Maybe add some debug file-logging to s60launcher.cpp to see if it's started at all?

  14. #14
    Regular Contributor
    Join Date
    Oct 2011
    Posts
    54

    Re: display autostart in Qt application ?

    Hi treinio
    Many thanks for the article. I followed it and I am able to start my app automatically without any problem.

  15. #15
    Regular Contributor
    Join Date
    Oct 2011
    Posts
    54

    Re: display autostart in Qt application ?

    Hi, I used this link http://www.developer.nokia.com/Commu...Qt_for_Symbian, to integrate autostart in my application. Its working fine without any problems, but when I use a space for the application name in DEPLOYMENT.display_name, the application is not autostarting. Can you please help.

Similar Threads

  1. Qt for Symbian development resources
    By liuxg in forum [Archived] Qt General ( Qt技术)
    Replies: 55
    Last Post: 2011-01-26, 04:06
  2. iPhone Blogger Blog Creation Application
    By semaphore10 in forum News and Announcements
    Replies: 4
    Last Post: 2009-10-06, 08:49
  3. How to display CAknWaitDialog in a hidden background application task
    By hyuan in forum Series 40 & S60 Platform Feedback Archive
    Replies: 0
    Last Post: 2009-07-26, 21:24
  4. Autostart an Application in S60 v3
    By kamaljaiswal in forum Symbian
    Replies: 18
    Last Post: 2007-05-07, 11:53

Posting Permissions

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