You Are Here:

Community: Wiki

This page was last modified on 20 September 2009, at 16:19.

Autostart applications on bootup in Qt for Symbian

From Forum Nokia Wiki

Reviewer Approved   

Contents

Descriptions

For implementing autostart in Qt, we need to use Startup List Management API of symbian. The procedure to implement autostart in Qt is same as described in How to autostart an application on boot up in 3rd- Startup List Management API, so this article is, specially, useful to those developer who are not familiar with Symbian.

Startup List Management API

Steps for auto-starting an EXE on boot time in Qt for Symbian.

1. Create an .RSS file in your project's directories.

For example: 06000001.rss

Here a number is used for the name, which is the same as the Package UID (pUID) of the project. This might help later in identifying the resource and is a good reminder when adding the entry in the PKG file. The name is however irrelevant at this point.

Add the following code to the new .rss file:

#include <startupitem.rh>
 
RESOURCE STARTUP_ITEM_INFO startexe
{
executable_name = "!:\\sys\\bin\\StartEXE.exe";
recovery = EStartupItemExPolicyNone;
}

In the code above:

  • StartEXE.exe is the name of the application to be started and this will of course depend on your choice of name for your project. Must be the same as specified for the TARGET statement in the MMP file.

2. Open your .PRO file.

Add the following lines to include the new resource in the build and attach .RSC file to package.

/* the following line is automatically added to .pro file by carbide IDE */
SOURCES += 06000001.rss \
 
/* the following lines add resource file to .mmp file*/
autoStartBlock = \
"START RESOURCE 06000001.rss" \
"END"
 
MMP_RULES += autoStartBlock
 
/* following line attach the resource to .pkg file */
symbian: {
/* Add full path of .rsc file which is created at epoc32\data folder */
addFiles.sources = D:\S60\devices\S60_5th_Edition_SDK_v0.9\epoc32\data\06000001.rsc
/*Application can be installed on any drive (either phone memory or memory card) but resource file [uid].rsc must be in c:\private\101f875a\import\ . */
addFiles.path = c:\private\101f875a\import
DEPLOYMENT += addFiles
}
END

3. Add one more .pkg file to your application.

The name of the file must be changed when copied on the device. It will always be the Package UID (pUID) (as specified in the header of the PKG file) but without the 0x prefix and enclosed by square brackets ([ and ]). The .pkg files generated by qmake will not be modified by the user. so add one more .pkg file to your application and add content from existing pkg file. Then open your new .pkg file and modify it as follows.

Modify your .pkg file From

"d:\S60\devices\S60_5th_Edition_SDK_v0.9\epoc32\data\06000001.rsc"-"c:\private\101f875a\import\06000001.rsc"


To

"d:\S60\devices\S60_5th_Edition_SDK_v0.9\epoc32\data\06000001.rsc-"c:\private\101f875a\import\[06000001].rsc"

4. That's it. Now just re-build the project with new .pkg file and make sure that the new resource file is built and if everything else is ok with the project you will obtain a sis files ready to install on the phone. On the next phone reboot your application will be started automatically.

Notes

  • If the EXE exits within a few (about 5?) seconds of starting up, a message is displayed, reading: Unable to start <name of EXE>. Application may need to be removed.
  • There are several Known Issues and Technical Solutions about using the Startup List logged in the Forum Nokia Technical Library. Search for "Startup List" to get an up-to-date overview.
  • Startup List Management API does not work with Self-Signed application. It should be signed with a trusted certificate (Open Signed Online or Open Signed Offline during R&D stage and Symbian Signed when released) even if otherwise the capabilities required for the project do not justify it.
  • The exe to be started must be installed directly from the root of the package that contains the resource file (not accepted from embedded file)

Download Example Code

Startup List Management Example in Qt

Rate This

 
Bookmark this page: DeliciousDiggFacebookGoogleYahooStumbleUponRedditDiigoTechnocratiTwitter  Share this page Share this page Print this Page Print this page Invite a friend Invite a friend
京ICP备05048969号    Email Newsletters Press Terms & Conditions Privacy Policy Sitemap Contact Us © 2009 Nokia 
RDF Facets: qdcZidentifierQSxhttpE3aE2fE2fwikiE2eforumE2enokiaE2ecomE2findeE78E2ephpE2fE25E454E25B8E25AE44E25E456E2596E2587E5fS60X qdcZtypeQUqfnZE45E78cludedFromGeneralE4cistingsQ qdcZtypeQUqfntypeZCommunityContentQ qdcZtypeQUqfntypeZE52esourceQ qdcZtypeQUqfntypeZWebpageQ qdcZtypeQUqfntypeZWikiContentQ qdcZtypeQUqmarsZManagedE52esourceQ qdcZtypeQUqwebZInformationE52esourceQ qdcZtypeQUqwebZPageQ qdcZtypeQUqwebZE52esourceQ qdcZtypeQUqrdfsZE52esourceQ qfnZtypeQUqfntypeZCommunityContentQ qfnZtypeQUqfntypeZE52esourceQ qfnZtypeQUqfntypeZWebpageQ qfnZtypeQUqfntypeZWikiContentQ qmarsZlanguageQUxhttpE3aE2fE2fswE2enokiaE2ecomE2flanguageE2d1E2fenX qrdfZtypeQUqfnZE45E78cludedFromGeneralE4cistingsQ qrdfZtypeQUqfntypeZCommunityContentQ qrdfZtypeQUqfntypeZE52esourceQ qrdfZtypeQUqfntypeZWebpageQ qrdfZtypeQUqfntypeZWikiContentQ qrdfZtypeQUqmarsZManagedE52esourceQ qrdfZtypeQUqwebZInformationE52esourceQ qrdfZtypeQUqwebZPageQ qrdfZtypeQUqwebZE52esourceQ qrdfZtypeQUqrdfsZE52esourceQ