Sunday, August 10, 2008

Developing a console Application That works in Background - 1

May be this kinda short-ass article has been written many times before. But I am sort of a dumb-truck and I cannot remember things for long. That is why I am writing this for myself.

My requirement is : I want to build an application that :

1. Will Auto start right after installing.
2. Will be a console application - so it will work on background.
3. It will periodically do something (for now - it will write some files).
4. May be it will have to restart whenever the device is restarted.


To create an Application that fulfills the above stated requirements isnt that hard if one has sufficient amount of experience with Symbian. Like, for requirement No.2 - we can build a console Application that does not have a UI. The console Application skeleton that VS2005 creates for us have some things related to colsole which waits for user input in a command prompt like thing. Only if we scrape off all those codes , we can then have a true background Application that does not show up in the task managers running tasks and which does not have any kind of GUI either.

Now, for requirement No.1 we have to write FR(FileRun) and RI(RunInstall) in the .pkg file. Here is a sample line :
"C:\Symbian\9.1\S60_3rd\epoc32\release\gcce\urel\consoleapp.exe"-"!:\sys\bin\consoleapp.exe, FR,RI. This will make the application auto run right after installing. (Important thing: You have to make it symbian signed if you want to use it on device.Self signing does not work for FR,RI options - as far as I know!!)

For requirement No.4 one has to look at this , although this is for S60 2nd edition devices. They say that one has to use at least two of the four APIs described in the article. I was building the App for Symbian S60 3rd edition (init release) phones. So, I did not need the "SonyEricsson AutoStarter API".

For requirement No.3 , we have to set up an activescheduler so that we can install an active object. And after constructing the active object and adding it to the scheduler, we have to start the scheduler(Because active scheduler needs at least one active object waiting on it when it is started.)

0 comments: